本文整理汇总了Java中de.fuberlin.wiwiss.d2rq.vocab.ISWC类的典型用法代码示例。如果您正苦于以下问题:Java ISWC类的具体用法?Java ISWC怎么用?Java ISWC使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ISWC类属于de.fuberlin.wiwiss.d2rq.vocab包,在下文中一共展示了ISWC类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: main
import de.fuberlin.wiwiss.d2rq.vocab.ISWC; //导入依赖的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: testSPARQLFetch
import de.fuberlin.wiwiss.d2rq.vocab.ISWC; //导入依赖的package包/类
public void testSPARQLFetch() {
sparql("SELECT ?x ?y WHERE { <http://test/papers/1> ?x ?y }");
// dump();
expectVariable("x", ISWC.conference);
expectVariable("y", this.model.createResource("http://test/conferences/23541"));
assertSolution();
expectVariable("x", SKOS.primarySubject);
expectVariable("y", this.model.createResource("http://test/topics/5"));
assertSolution();
expectVariable("x", SKOS.subject);
expectVariable("y", this.model.createResource("http://test/topics/15"));
assertSolution();
expectVariable("x", DC.date);
expectVariable("y", this.model.createTypedLiteral("2002", XSDDatatype.XSDgYear));
assertSolution();
expectVariable("x", DC.title);
expectVariable("y", this.model.createLiteral("Trusting Information Sources One Citizen at a Time", "en"));
assertSolution();
expectVariable("x", RDF.type);
expectVariable("y", ISWC.InProceedings);
assertSolution();
assertResultCount(12);
}
示例3: testListTypeStatements
import de.fuberlin.wiwiss.d2rq.vocab.ISWC; //导入依赖的package包/类
public void testListTypeStatements() {
find(null, RDF.type, null);
// dump();
assertStatement(resource("papers/1"), RDF.type, ISWC.InProceedings);
// Paper6 is filtered by d2rq:condition
assertNoStatement(resource("papers/6"), RDF.type, ISWC.InProceedings);
assertStatement(resource("conferences/23541"), RDF.type, ISWC.Conference);
assertStatement(resource("topics/15"), RDF.type, SKOS.Concept);
assertStatementCount(95);
}
示例4: testDefinitions
import de.fuberlin.wiwiss.d2rq.vocab.ISWC; //导入依赖的package包/类
public void testDefinitions() {
find(ISWC.Conference, null, null);
assertStatement(ISWC.Conference, RDF.type, RDFS.Class);
assertStatement(ISWC.Conference, RDFS.label, m.createLiteral("conference"));
assertStatement(ISWC.Conference, RDFS.comment, m.createLiteral("A conference"));
assertStatement(ISWC.Conference, RDFS.subClassOf, ISWC.Event);
find(RDFS.label, null, null);
assertStatement(RDFS.label, RDF.type, RDF.Property);
assertStatement(RDFS.label, RDFS.label, m.createLiteral("label"));
assertStatement(RDFS.label, RDFS.comment, m.createLiteral("A human-readable name for the subject."));
assertStatement(RDFS.label, RDFS.domain, RDFS.Resource);
}