当前位置: 首页>>代码示例>>Java>>正文


Java DCTERMS类代码示例

本文整理汇总了Java中org.eclipse.rdf4j.model.vocabulary.DCTERMS的典型用法代码示例。如果您正苦于以下问题:Java DCTERMS类的具体用法?Java DCTERMS怎么用?Java DCTERMS使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


DCTERMS类属于org.eclipse.rdf4j.model.vocabulary包,在下文中一共展示了DCTERMS类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addPropertyValue

import org.eclipse.rdf4j.model.vocabulary.DCTERMS; //导入依赖的package包/类
/**
 * Adds a property value (a triple describing the Resource).
 *
 * @param tripleDF the triple display format
 * @throws RMapWebException the RMap web exception
 */
public void addPropertyValue(TripleDisplayFormat tripleDF) throws RMapWebException {
	if (tripleDF!=null) {
		
		//these predicates should be first in the list. Property Values list is ordered alphabetically.
		String[] bubbleToTop = {DC.TITLE.toString(),DCTERMS.TITLE.toString(),FOAF.NAME.toString(),
								RDFS.LABEL.toString(), RDFS.SEEALSO.toString(), DC.IDENTIFIER.toString(),
								DCTERMS.IDENTIFIER.toString(), SKOS.PREF_LABEL.toString()};
		
		String listKey;
		String predicate= tripleDF.getPredicate().toString();
		//if it's a title, name or label, bubble to top of list.
		if (Arrays.asList(bubbleToTop).contains(predicate)){
			listKey = tripleDF.getSubjectDisplay()+"______a" + tripleDF.getPredicateDisplay()+tripleDF.getObjectDisplay();	
		} else {
			listKey = tripleDF.getSubjectDisplay()+tripleDF.getPredicateDisplay()+tripleDF.getObjectDisplay();	
		}
		
		this.propertyValues.put(listKey, tripleDF);
	} else {
		throw new RMapWebException(ErrorCode.ER_RESOURCE_PROPERTY_VALUE_NULL);
	}
}
 
开发者ID:rmap-project,项目名称:rmap,代码行数:29,代码来源:ResourceDescription.java

示例2: addAddtionalResource

import org.eclipse.rdf4j.model.vocabulary.DCTERMS; //导入依赖的package包/类
private void addAddtionalResource(List<Statement> statements) throws
        StoreManagerException {
    List<Statement> otherResources = new ArrayList<>();
    for (Statement st : statements) {
        IRI predicate = st.getPredicate();
        Value object = st.getObject();
        if (predicate.equals(FDP.METADATA_IDENTIFIER)) {
            otherResources.addAll(storeManager.retrieveResource(
                    (IRI) object));
        } else if (predicate.equals(R3D.INSTITUTION)) {
            otherResources.addAll(storeManager.retrieveResource(
                    (IRI) object));
        } else if (predicate.equals(DCTERMS.PUBLISHER)) {
            otherResources.addAll(storeManager.retrieveResource(
                    (IRI) object));
        } else if (predicate.equals(R3D.REPO_IDENTIFIER)) {
            otherResources.addAll(storeManager.retrieveResource(
                    (IRI) object));
        }
    }
    statements.addAll(otherResources);
}
 
开发者ID:DTL-FAIRData,项目名称:FAIRDataPoint,代码行数:23,代码来源:FairMetaDataServiceImpl.java

示例3: getStatements

import org.eclipse.rdf4j.model.vocabulary.DCTERMS; //导入依赖的package包/类
/**
 *
 * Get RDF statements from dataRecord metadata object
 *
 * @param model RDF model with common metadata properties
 * @param metadata DataRecordMetadata object
 * @return List of RDF statements
 * @throws MetadataException
 */
private static List<Statement> getStatements(Model model,
        DataRecordMetadata metadata)
        throws MetadataException {
    try {
        Preconditions.checkNotNull(metadata.getRmlURI(),
                "Metadata rml mapping uri must not be null.");
    } catch (NullPointerException | IllegalArgumentException ex) {
        throw (new MetadataException(ex.getMessage()));
    }

    LOGGER.info("Adding dataRecord metadata properties to the rdf model");
    addStatement(model, metadata.getUri(), RDF.TYPE, 
            DCAT.TYPE_DISTRIBUTION);
    addStatement(model,metadata.getUri(), FDP.RML_MAPPING, 
            metadata.getRmlURI());
    addStatement(model,metadata.getUri(), FDP.REFERS_TO,
                metadata.getDistributionURI());
    addStatement(model,metadata.getUri(), DCTERMS.ISSUED,
                metadata.getDataRecordIssued());
    addStatement(model,metadata.getUri(), DCTERMS.MODIFIED,
                metadata.getDataRecordModified());
    return getStatements(model);
}
 
开发者ID:DTL-FAIRData,项目名称:fairmetadata4j,代码行数:33,代码来源:MetadataUtils.java

示例4: propagateToHandler

import org.eclipse.rdf4j.model.vocabulary.DCTERMS; //导入依赖的package包/类
private static void propagateToHandler(List<Statement> statements,
        RDFHandler handler)
        throws RDFHandlerException, RepositoryException {
    handler.startRDF();
    handler.handleNamespace(RDF.PREFIX, RDF.NAMESPACE);
    handler.handleNamespace(RDFS.PREFIX, RDFS.NAMESPACE);
    handler.handleNamespace(DCAT.PREFIX, DCAT.NAMESPACE);
    handler.handleNamespace(XMLSchema.PREFIX, XMLSchema.NAMESPACE);
    handler.handleNamespace(OWL.PREFIX, OWL.NAMESPACE);
    handler.handleNamespace(DCTERMS.PREFIX, DCTERMS.NAMESPACE);
    handler.handleNamespace(FDP.PREFIX, FDP.NAMESPACE);
    handler.handleNamespace(R3D.PREFIX, R3D.NAMESPACE);
    handler.handleNamespace("lang",
            "http://id.loc.gov/vocabulary/iso639-1/");
    for (Statement st : statements) {
        handler.handleStatement(st);
    }
    handler.endRDF();
}
 
开发者ID:DTL-FAIRData,项目名称:fairmetadata4j,代码行数:20,代码来源:MetadataUtils.java

示例5: hasLang

import org.eclipse.rdf4j.model.vocabulary.DCTERMS; //导入依赖的package包/类
/**
 * Check if a dataset / distribution is available in a certain language
 * 
 * @param map
 * @param lang
 * @return boolean 
 */
private static boolean hasLang(Map<IRI, ListMultimap<String, String>> map, 
                                                            String lang) {
    List<String> datalangs = Storage.getMany(map, DCTERMS.LANGUAGE, "");

    // If there is no language info, assume info is language-neutral
    if (datalangs.isEmpty()) {
        return true;
    }
    
    for(String datalang : datalangs) {
        if (MDR_LANG.MAP.get(lang).toString().equals(datalang)) {
            return true;
        }
    }
    return false;
}
 
开发者ID:Fedict,项目名称:dcattools,代码行数:24,代码来源:Drupal.java

示例6: getModif

import org.eclipse.rdf4j.model.vocabulary.DCTERMS; //导入依赖的package包/类
/**
 * Get modification date
 * 
 * @param dataset
 * @return 
 */
private Date getModif(Map<IRI, ListMultimap<String, String>> dataset) {
    Date modif = new Date();
    String m = Storage.getOne(dataset, DCTERMS.MODIFIED, "");
    if (m.isEmpty()) {
       m = Storage.getOne(dataset, DCTERMS.ISSUED, ""); 
    }
    if (!m.isEmpty() && (m.length() >= 10)) {
        try {
            modif = Drupal.ISODATE.parse(m.substring(0, 10));
        } catch (ParseException ex) {
            logger.error("Exception parsing {} as date", m);
        }
    }
    return modif;
}
 
开发者ID:Fedict,项目名称:dcattools,代码行数:22,代码来源:Drupal.java

示例7: writeDates

import org.eclipse.rdf4j.model.vocabulary.DCTERMS; //导入依赖的package包/类
/**
 * Write temporal date info for a dcat:Dataset
 * 
 * @param w XML writer
 * @param con RDF triple store connection
 * @param uri dataset URI
 * @throws XMLStreamException 
 */
private static void writeDates(XMLStreamWriter w, RepositoryConnection con, IRI uri)
		throws XMLStreamException {
	try (RepositoryResult<Statement> res = con.getStatements(uri, DCTERMS.TEMPORAL, null)) {
		while (res.hasNext()) {
			Value v = res.next().getObject();
			if (v instanceof IRI) {
				IRI date = (IRI) v;
				w.writeStartElement("dct:temporal");
				w.writeStartElement("dct:PeriodOfTime");
				writeLiterals(w, con, date, STARTDATE, "schema:startDate");
				writeLiterals(w, con, date, ENDDATE, "schema:endDate");
				w.writeEndElement();
				w.writeEndElement();
			} else {
				logger.error("Not a date IRI {}", v.stringValue());
			}
		}
	}
}
 
开发者ID:Fedict,项目名称:dcattools,代码行数:28,代码来源:EDP.java

示例8: writeLicenses

import org.eclipse.rdf4j.model.vocabulary.DCTERMS; //导入依赖的package包/类
/**
 * Write multiple format
 * 
 * @param w XML writer
 * @param con RDF triple store connection
 * @param uri URI of the dataset
 * @param pred RDF predicate
 * @param el element name
 * @throws XMLStreamException 
 */
private static void writeLicenses(XMLStreamWriter w, RepositoryConnection con,
		IRI uri, IRI pred) throws XMLStreamException {
	try (RepositoryResult<Statement> res = con.getStatements(uri, pred, null)) {
		if (res.hasNext()) {
			Value v = res.next().getObject();
			if (v instanceof IRI) {
				IRI license = (IRI) v;
				w.writeStartElement("dct:license");
				w.writeStartElement("dct:LicenseDocument");
				writeLiterals(w, con, license, DCTERMS.TITLE, "dct:title");
				w.writeEndElement();
				w.writeEndElement();
			} else {
				logger.error("Not a license IRI {}", v.stringValue());
			}
		}
	}
}
 
开发者ID:Fedict,项目名称:dcattools,代码行数:29,代码来源:EDP.java

示例9: writeDist

import org.eclipse.rdf4j.model.vocabulary.DCTERMS; //导入依赖的package包/类
/**
 * Write dcat distribution
 * 
 * @param w XML writer
 * @param con RDF triple store connection
 * @param uri URI of the dataset
 * @throws XMLStreamException 
 */
private static void writeDist(XMLStreamWriter w, RepositoryConnection con,
		IRI uri) throws XMLStreamException {
	w.writeStartElement("dcat:Distribution");	
	w.writeAttribute("rdf:about", uri.stringValue());

	writeGeneric(w, con, uri);

//	writeReferences(w, con, uri, DCTERMS.FORMAT, "dct:format");
	writeFormats(w, con, uri, DCAT.MEDIA_TYPE);
	
	// write as anyURI string
	writeReferences(w, con, uri, DCAT.ACCESS_URL, "dcat:accessURL");
	writeReferences(w, con, uri, DCAT.DOWNLOAD_URL, "dcat:downloadURL");
	
	writeLicenses(w, con, uri, DCTERMS.LICENSE);
	
	w.writeEndElement();
}
 
开发者ID:Fedict,项目名称:dcattools,代码行数:27,代码来源:EDP.java

示例10: writeDataset

import org.eclipse.rdf4j.model.vocabulary.DCTERMS; //导入依赖的package包/类
/**
 * Write DCAT dataset
 * 
 * @param w XML writer
 * @param con RDF triple store connection
 * @param uri URI of the dataset
 * @throws XMLStreamException 
 */
private static void writeDataset(XMLStreamWriter w, RepositoryConnection con,
		IRI uri) throws XMLStreamException {
	w.writeStartElement("dcat:Dataset");	
	w.writeAttribute("rdf:about", uri.stringValue());

	writeGeneric(w, con, uri);

	writeLiterals(w, con, uri, DCAT.KEYWORD, "dcat:keyword");	
	writeReferences(w, con, uri, DCAT.THEME, "dcat:theme");
	writeReferences(w, con, uri, DCAT.LANDING_PAGE, "dcat:landingPage");
	
	try (RepositoryResult<Statement> res = con.getStatements(uri, DCAT.HAS_DISTRIBUTION, null)) {
		while (res.hasNext()) {
			w.writeStartElement("dcat:distribution");
			writeDist(w, con, (IRI) res.next().getObject());
			w.writeEndElement();
		}
	}
	writeContacts(w, con, uri, DCAT.CONTACT_POINT);
	writeReferences(w, con, uri, DCTERMS.ACCRUAL_PERIODICITY, "dct:accrualPeriodicity");
	
	writeDates(w, con, uri);
	
	w.writeEndElement();
}
 
开发者ID:Fedict,项目名称:dcattools,代码行数:34,代码来源:EDP.java

示例11: writeCatalog

import org.eclipse.rdf4j.model.vocabulary.DCTERMS; //导入依赖的package包/类
/**
 * Write DCAT catalog to XML.
 * 
 * @param w XML writer
 * @param con RDF triple store connection
 */
private static void writeCatalog(XMLStreamWriter w, RepositoryConnection con) 
		throws XMLStreamException {
	String cat = "http://data.gov.be/catalog";
	
	w.writeStartElement("rdf:RDF");
	writePrefixes(w);
	
	w.writeStartElement("dcat:Catalog");
	w.writeAttribute("dct:identifier", cat);
	w.writeAttribute("rdf:about", cat);

	IRI uri = con.getValueFactory().createIRI(cat);
	writeGeneric(w, con, uri);		
	writeReferences(w, con, uri, FOAF.HOMEPAGE, "foaf:homepage");
	writeLicenses(w, con, uri, DCTERMS.LICENSE);
	writeDatasets(w, con);
	
	w.writeEndElement();
	
	writeOrgs(w, con);
	
	w.writeEndElement();
}
 
开发者ID:Fedict,项目名称:dcattools,代码行数:30,代码来源:EDP.java

示例12: generateDist

import org.eclipse.rdf4j.model.vocabulary.DCTERMS; //导入依赖的package包/类
/**
 * Generate DCAT distribution.
 *
 * @param store RDF store
 * @param dataset URI
 * @param access access URL of the dataset
 * @param link link element
 * @param i row sequence
 * @param lang language code
 * @throws MalformedURLException
 * @throws RepositoryException
 */
private void generateDist(Storage store, IRI dataset, URL access,
		Elements link, int i, String lang)
		throws MalformedURLException, RepositoryException {
	String href = link.first().attr(Attribute.HREF.toString());
	URL download = makeAbsURL(href);

	URL u = makeDistURL(i + "/" + lang);
	IRI dist = store.getURI(u.toString());
	logger.debug("Generating distribution {}", dist.toString());

	store.add(dataset, DCAT.HAS_DISTRIBUTION, dist);
	store.add(dist, RDF.TYPE, DCAT.DISTRIBUTION);
	store.add(dist, DCTERMS.LANGUAGE, MDR_LANG.MAP.get(lang));
	store.add(dist, DCTERMS.TITLE, link.first().ownText(), lang);
	store.add(dist, DCAT.ACCESS_URL, access);
	store.add(dist, DCAT.DOWNLOAD_URL, download);
	store.add(dist, DCAT.MEDIA_TYPE, getFileExt(href));
}
 
开发者ID:Fedict,项目名称:dcattools,代码行数:31,代码来源:HtmlFodMobilit.java

示例13: generateDataset

import org.eclipse.rdf4j.model.vocabulary.DCTERMS; //导入依赖的package包/类
/**
 * Generate one dataset
 *
 * @param store RDF store
 * @param front front
 * @param row HTML row
 * @param i number
 * @param lang language
 * @throws MalformedURLException
 * @throws RepositoryException
 */
private void generateDataset(Storage store, URL front, Element row, int i, String lang)
		throws MalformedURLException, RepositoryException {
	URL u = makeDatasetURL(String.valueOf(i));
	IRI dataset = store.getURI(u.toString());
	logger.debug("Generating dataset {}", dataset.toString());

	Elements cells = row.getElementsByTag(Tag.TD.toString());
	String desc = cells.get(0).text();
	String title = desc;

	store.add(dataset, RDF.TYPE, DCAT.DATASET);
	store.add(dataset, DCTERMS.LANGUAGE, MDR_LANG.MAP.get(lang));
	store.add(dataset, DCTERMS.TITLE, title, lang);
	store.add(dataset, DCTERMS.DESCRIPTION, desc, lang);
	store.add(dataset, DCTERMS.IDENTIFIER, makeHashId(u.toString()));
	store.add(dataset, DCAT.LANDING_PAGE, front);

	Elements link = cells.get(1).getElementsByTag(Tag.A.toString());
	generateDist(store, dataset, front, link, i, lang);
}
 
开发者ID:Fedict,项目名称:dcattools,代码行数:32,代码来源:HtmlFodMobilit.java

示例14: generateDist

import org.eclipse.rdf4j.model.vocabulary.DCTERMS; //导入依赖的package包/类
/**
 * Generate DCAT Distribution.
 *
 * @param store RDF store
 * @param dataset dataset URI
 * @param access access URL
 * @param link link element
 * @param lang language code
 * @throws MalformedUrlException
 * @throws RepositoryException
 */
private void generateDist(Storage store, IRI dataset, URL access, Element link,
		String lang) throws MalformedURLException, RepositoryException {
	String href = link.attr(Attribute.HREF.toString());
	URL download = makeAbsURL(href);

	// important for EDP: does not like different datasets pointing to same distribution
	String id = makeHashId(dataset.toString()) + "/" + makeHashId(download.toString());
	IRI dist = store.getURI(makeDistURL(id).toString() + "/" + lang);
	logger.debug("Generating distribution {}", dist.toString());

	store.add(dataset, DCAT.HAS_DISTRIBUTION, dist);
	store.add(dist, RDF.TYPE, DCAT.DISTRIBUTION);
	store.add(dist, DCTERMS.LANGUAGE, MDR_LANG.MAP.get(lang));
	store.add(dist, DCTERMS.TITLE, link.ownText(), lang);
	store.add(dist, DCAT.ACCESS_URL, access);
	store.add(dist, DCAT.DOWNLOAD_URL, download);
	store.add(dist, DCAT.MEDIA_TYPE, getFileExt(href));
}
 
开发者ID:Fedict,项目名称:dcattools,代码行数:30,代码来源:HtmlStatbelPubs.java

示例15: generateDist

import org.eclipse.rdf4j.model.vocabulary.DCTERMS; //导入依赖的package包/类
/**
 * Generate DCAT Distribution.
 *
 * @param store RDF store
 * @param dataset dataset URI
 * @param access access URL
 * @param link link element
 * @param lang language code
 * @throws MalformedUrlException
 * @throws RepositoryException
 */
private void generateDist(Storage store, IRI dataset, URL access, Element link,
		String lang) throws MalformedURLException, RepositoryException {
	String href = link.attr(Attribute.HREF.toString());
	URL download = makeAbsURL(href);

	String id = makeHashId(dataset.toString()) + "/" + makeHashId(download.toString());
	IRI dist = store.getURI(makeDistURL(id).toString() + "/" + lang);
	logger.debug("Generating distribution {}", dist.toString());

	store.add(dataset, DCAT.HAS_DISTRIBUTION, dist);
	store.add(dist, RDF.TYPE, DCAT.DISTRIBUTION);
	store.add(dist, DCTERMS.LANGUAGE, MDR_LANG.MAP.get(lang));
	store.add(dist, DCTERMS.TITLE, link.ownText(), lang);
	store.add(dist, DCAT.ACCESS_URL, access);
	store.add(dist, DCAT.DOWNLOAD_URL, download);
	store.add(dist, DCAT.MEDIA_TYPE, link.ownText());
}
 
开发者ID:Fedict,项目名称:dcattools,代码行数:29,代码来源:HtmlStatbelOpen.java


注:本文中的org.eclipse.rdf4j.model.vocabulary.DCTERMS类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。