本文整理汇总了Java中com.hp.hpl.jena.vocabulary.DC类的典型用法代码示例。如果您正苦于以下问题:Java DC类的具体用法?Java DC怎么用?Java DC使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DC类属于com.hp.hpl.jena.vocabulary包,在下文中一共展示了DC类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: main
import com.hp.hpl.jena.vocabulary.DC; //导入依赖的package包/类
public static void main(String[] args) {
// Set up the ModelD2RQ using a mapping file
ModelD2RQ m = new ModelD2RQ("file:doc/example/mapping-iswc.ttl");
// Find anything with an rdf:type of iswc:InProceedings
StmtIterator paperIt = m.listStatements(null, RDF.type, ISWC.InProceedings);
// List found papers and print their titles
while (paperIt.hasNext()) {
Resource paper = paperIt.nextStatement().getSubject();
System.out.println("Paper: " + paper.getProperty(DC.title).getString());
// List authors of the paper and print their names
StmtIterator authorIt = paper.listProperties(DC.creator);
while (authorIt.hasNext()) {
Resource author = authorIt.nextStatement().getResource();
System.out.println("Author: " + author.getProperty(FOAF.name).getString());
}
System.out.println();
}
m.close();
}
示例2: setModelPrefix
import com.hp.hpl.jena.vocabulary.DC; //导入依赖的package包/类
public static void setModelPrefix(Model model){
model.setNsPrefix("biopax", Biopax_level3.getURI());
model.setNsPrefix("gpml", Gpml.getURI());
model.setNsPrefix("wp", Wp.getURI());
model.setNsPrefix("xsd", XSD.getURI());
model.setNsPrefix("rdf", RDF.getURI());
model.setNsPrefix("rdfs", RDFS.getURI());
model.setNsPrefix("dcterms", DCTerms.getURI());
model.setNsPrefix("wprdf", "http://rdf.wikipathways.org/");
model.setNsPrefix("foaf", FOAF.getURI());
model.setNsPrefix("dc", DC.getURI());
model.setNsPrefix("skos", Skos.getURI());
model.setNsPrefix("void", Void.getURI());
model.setNsPrefix("wprdf", "http://rdf.wikipathways.org/");
model.setNsPrefix("pav", Pav.getURI());
model.setNsPrefix("prov", Prov.getURI());
model.setNsPrefix("dcterms", DCTerms.getURI());
model.setNsPrefix("freq", Freq.getURI());
}
示例3: showThisStatement
import com.hp.hpl.jena.vocabulary.DC; //导入依赖的package包/类
public boolean showThisStatement(Statement statement) {
Property predicate = statement.getPredicate();
if (predicate.equals(RDF.type) || predicate.equals(DC.date) || predicate.equals(RDFS.label)
|| predicate.equals(RDFS.comment) || predicate.equals(MindRaiderVocabulary.isDiscarded)
|| predicate.equals(MindRaiderVocabulary.xlinkHref)
|| predicate.equals(MindRaiderVocabulary.flagProperty)) {
return false;
}
// do not show trash content
String uri = statement.getSubject().getURI();
if (uri != null && uri.endsWith(NoteCustodian.NOTEBOOK_TRASH_LOCAL_NAME)) {
return false;
}
return true;
}
示例4: createDataset
import com.hp.hpl.jena.vocabulary.DC; //导入依赖的package包/类
private Resource createDataset() {
Resource ds = model.createResource(localNS.DATASET + "-" + id);
ds.addProperty(RDF.type, QB.DATASET);
ds.addProperty(RDFS.label, table.getMetadata().getLabel());
ds.addProperty(RDFS.comment, table.getMetadata().getDescription());
ds.addProperty(DC.relation, RELATION);
if (Config.GENERATE_1_2) {
ds.addProperty(DC.format, VERSION_1_2);
} else {
ds.addProperty(DC.format, VERSION_1_1);
}
for (String source : table.getMetadata().getSources()) {
ds.addProperty(DC.source, source);
}
Literal l = model.createTypedLiteral(GregorianCalendar.getInstance());
ds.addProperty(DC.date, l);
return ds;
}
示例5: createDataset
import com.hp.hpl.jena.vocabulary.DC; //导入依赖的package包/类
private Resource createDataset() {
Resource ds = model.createResource(localNS.DATASET + "-" + id);
ds.addProperty(RDF.type, QB.DATASET);
ds.addProperty(RDFS.label, table.getMetadata().getLabel());
ds.addProperty(RDFS.comment, table.getMetadata().getDescription());
ds.addProperty(DC.relation, RELATION);
if (version.equals("1.1")) {
ds.addProperty(DC.format, VERSION_1_1);
} else {
ds.addProperty(DC.format, VERSION_1_2);
}
for (String source : table.getMetadata().getSources()) {
ds.addProperty(DC.source, source);
}
Literal l = model.createTypedLiteral(GregorianCalendar.getInstance());
ds.addProperty(DC.date, l);
return ds;
}
示例6: handleTriple
import com.hp.hpl.jena.vocabulary.DC; //导入依赖的package包/类
@Override
public void handleTriple(Triple triple) {
Node subject = triple.getSubject();
if (!subject.isBlank()) {
String subjUri = subject.getURI();
if (subjUri.startsWith(LOD_STATS_DOC_BASE_URI)) {
int datasetId = getDatasetIdFromUri(subjUri);
if (datasetId >= 0) {
DatasetDescription description;
if (descriptions.containsKey(datasetId)) {
description = descriptions.get(datasetId);
} else {
description = new DatasetDescription(subjUri);
descriptions.put(datasetId, description);
}
if (triple.getPredicate().getURI().equals(DCAT_ACCESS_URL_URI)) {
description.title = triple.getObject().toString();
} else if (triple.getPredicate().equals(DC.source.asNode())) {
description.description = "Accessed through " + triple.getObject().toString();
}
}
}
}
}
示例7: add_text_annotation
import com.hp.hpl.jena.vocabulary.DC; //导入依赖的package包/类
private Resource add_text_annotation(String annotation_uri,
String target_uri, String text, String format, String label) {
Resource text_annotation = model.createResource(annotation_uri);
text_annotation.addProperty(RDFS.label, label);
text_annotation.addProperty(RDF.type, annotation_type);
text_annotation.addProperty(motivated_by, describing_motivation);
Resource target = model.createResource(target_uri);
text_annotation.addProperty(has_target, target);
Resource text_annotation_body = model.createResource();
text_annotation_body.addProperty(RDF.type, DCTypes.Text);
text_annotation_body.addProperty(RDF.type, content_as_text_type);
text_annotation_body.addProperty(DC.format, format);
text_annotation_body.addProperty(character_content, text);
text_annotation.addProperty(has_body, text_annotation_body);
return text_annotation;
}
示例8: main
import com.hp.hpl.jena.vocabulary.DC; //导入依赖的package包/类
public static void main(String[] args) {
// Load mapping file
Model mapModel = FileManager.get().loadModel("doc/example/mapping-iswc.ttl");
// Read mapping file
D2RQReader reader = new D2RQReader(mapModel, "http://localhost:2020/");
Mapping mapping = reader.getMapping();
// Compile mapping for D2RQ engine
CompiledMapping compiled = mapping.compile();
// Set up the GraphD2RQ
GraphD2RQ g = new GraphD2RQ(compiled);
// Create a find(spo) pattern
Node subject = Node.ANY;
Node predicate = DC.date.asNode();
Node object = Node.createLiteral("2003", null, XSDDatatype.XSDgYear);
Triple pattern = new Triple(subject, predicate, object);
// Query the graph
Iterator<Triple> it = g.find(pattern);
// Output query results
while (it.hasNext()) {
Triple t = it.next();
System.out.println("Published in 2003: " + t.getSubject());
}
g.close();
}
示例9: filterTripleRelations
import com.hp.hpl.jena.vocabulary.DC; //导入依赖的package包/类
private Collection<TripleRelation> filterTripleRelations(Collection<TripleRelation> entityDescription) {
List<TripleRelation> result = new ArrayList<TripleRelation>();
for (TripleRelation triples: entityDescription) {
triples = triples.orderBy(TripleRelation.SUBJECT, true);
if (!OpUtil.isEmpty(triples.selectTriple(new Triple(Node.ANY, RDF.Nodes.type, Node.ANY)).getBaseTabular())) {
result.add(triples);
}
// TODO: The list of label properties is redundantly specified in PageServlet
if (!OpUtil.isEmpty(triples.selectTriple(new Triple(Node.ANY, RDFS.label.asNode(), Node.ANY)).getBaseTabular())) {
result.add(triples);
} else if (!OpUtil.isEmpty(triples.selectTriple(new Triple(Node.ANY, SKOS.prefLabel.asNode(), Node.ANY)).getBaseTabular())) {
result.add(triples);
} else if (!OpUtil.isEmpty(triples.selectTriple(new Triple(Node.ANY, DC.title.asNode(), Node.ANY)).getBaseTabular())) {
result.add(triples);
} else if (!OpUtil.isEmpty(triples.selectTriple(new Triple(Node.ANY, DCTerms.title.asNode(), Node.ANY)).getBaseTabular())) {
result.add(triples);
} else if (!OpUtil.isEmpty(triples.selectTriple(new Triple(Node.ANY, FOAF.name.asNode(), Node.ANY)).getBaseTabular())) {
result.add(triples);
}
}
if (result.isEmpty()) {
result.add(new TripleRelation(sqlConnection, entityTable,
entityMaker,
new FixedNodeMaker(RDF.type.asNode()),
new FixedNodeMaker(RDFS.Resource.asNode())));
}
return result;
}
示例10: OntologyTarget
import com.hp.hpl.jena.vocabulary.DC; //导入依赖的package包/类
public OntologyTarget() {
model.setNsPrefix("rdf", RDF.getURI());
model.setNsPrefix("rdfs", RDFS.getURI());
model.setNsPrefix("owl", OWL.getURI());
model.setNsPrefix("dc", DC.getURI());
model.setNsPrefix("xsd", XSD.getURI());
}
示例11: init
import com.hp.hpl.jena.vocabulary.DC; //导入依赖的package包/类
public void init(String baseIRI, Resource generatedOntology,
boolean serveVocabulary, boolean generateDefinitionLabels) {
Resource ont = generatedOntology.inModel(model);
ont.addProperty(RDF.type, OWL.Ontology);
ont.addProperty(OWL.imports,
model.getResource(MappingGenerator.dropTrailingHash(DC.getURI())));
ont.addProperty(DC.creator, CREATOR);
this.generatedOntology = ont;
}
示例12: testListAuthors
import com.hp.hpl.jena.vocabulary.DC; //导入依赖的package包/类
@Test
public void testListAuthors() {
find(null, DC.creator, null);
// dump();
assertStatement(resource("papers/1"), DC.creator, resource("persons/1"));
assertStatement(resource("papers/1"), DC.creator, resource("persons/2"));
assertStatementCount(8);
}
示例13: testDatatypeFindByYear
import com.hp.hpl.jena.vocabulary.DC; //导入依赖的package包/类
@Test
public void testDatatypeFindByYear() {
find(null, DC.date, createTypedLiteral("2003", XSDDatatype.XSDgYear));
// dump();
assertStatement(resource("papers/4"), DC.date, createTypedLiteral("2003", XSDDatatype.XSDgYear));
assertStatementCount(1);
}
示例14: testDatatypeFindYear
import com.hp.hpl.jena.vocabulary.DC; //导入依赖的package包/类
@Test
public void testDatatypeFindYear() {
find(resource("papers/2"), DC.date, null);
// dump();
assertStatement(resource("papers/2"), DC.date, createTypedLiteral("2002", XSDDatatype.XSDgYear));
assertStatementCount(1);
}
示例15: testDatatypeYearContains
import com.hp.hpl.jena.vocabulary.DC; //导入依赖的package包/类
@Test
public void testDatatypeYearContains() {
find(resource("papers/2"), DC.date, createTypedLiteral("2002", XSDDatatype.XSDgYear));
// dump();
assertStatement(resource("papers/2"), DC.date, createTypedLiteral("2002", XSDDatatype.XSDgYear));
assertStatementCount(1);
}