本文整理汇总了Java中de.fuberlin.wiwiss.d2rq.jena.GraphD2RQ类的典型用法代码示例。如果您正苦于以下问题:Java GraphD2RQ类的具体用法?Java GraphD2RQ怎么用?Java GraphD2RQ使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
GraphD2RQ类属于de.fuberlin.wiwiss.d2rq.jena包,在下文中一共展示了GraphD2RQ类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: reload
import de.fuberlin.wiwiss.d2rq.jena.GraphD2RQ; //导入依赖的package包/类
private void reload() {
loader.getMapping().connect();
GraphD2RQ graph = loader.getGraphD2RQ();
datasetGraph = DatasetGraphFactory.createOneGraph(graph);
defaultModel = ModelFactory.createModelForGraph(datasetGraph.getDefaultGraph());
hasTruncatedResults = false;
for (Database db: loader.getMapping().databases()) {
if (db.getResultSizeLimit() != Database.NO_LIMIT) {
hasTruncatedResults = true;
}
}
if (autoReload) {
lastModified = watchedFile.lastModified();
lastReload = System.currentTimeMillis();
}
}
示例2: testGenerateTripleFromSimpleD2RQMapping
import de.fuberlin.wiwiss.d2rq.jena.GraphD2RQ; //导入依赖的package包/类
public void testGenerateTripleFromSimpleD2RQMapping() {
Mapping m = MappingHelper.readFromTestFile("helpers/simple.ttl");
m.configuration().setServeVocabulary(false);
db.executeSQL("INSERT INTO TEST VALUES (1, 'Hello World!')");
GraphD2RQ g = new GraphD2RQ(m);
assertTrue(g.contains(
Node.createURI(EX + "test/1"), RDF.Nodes.type, Node.createURI(EX + "Test")));
assertEquals(1, g.size());
}
示例3: main
import de.fuberlin.wiwiss.d2rq.jena.GraphD2RQ; //导入依赖的package包/类
public static void main(String[] args) {
// Load mapping file
Model mapModel = FileManager.get().loadModel("doc/example/mapping-iswc.ttl");
// Parse mapping file
MapParser parser = new MapParser(mapModel, "http://localhost:2020/");
Mapping mapping = parser.parse();
// Set up the GraphD2RQ
GraphD2RQ g = new GraphD2RQ(mapping);
// 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();
}
示例4: QueryEngineD2RQ
import de.fuberlin.wiwiss.d2rq.jena.GraphD2RQ; //导入依赖的package包/类
public QueryEngineD2RQ(GraphD2RQ graph, Query query) {
this(graph, query, null);
}
示例5: accept
import de.fuberlin.wiwiss.d2rq.jena.GraphD2RQ; //导入依赖的package包/类
public boolean accept(Query query, DatasetGraph dataset, Context context) {
return dataset.getDefaultGraph() instanceof GraphD2RQ;
}
示例6: create
import de.fuberlin.wiwiss.d2rq.jena.GraphD2RQ; //导入依赖的package包/类
public Plan create(Query query, DatasetGraph dataset,
Binding inputBinding, Context context) {
return new QueryEngineD2RQ((GraphD2RQ) dataset.getDefaultGraph(),
query, context).getPlan();
}
示例7: testDefaultMappingWithHelloWorld
import de.fuberlin.wiwiss.d2rq.jena.GraphD2RQ; //导入依赖的package包/类
public void testDefaultMappingWithHelloWorld() {
db.executeSQL("INSERT INTO TEST VALUES (1, 'Hello World!')");
GraphD2RQ g = generateDefaultGraphD2RQ();
assertTrue(g.contains(Node.ANY, Node.ANY, Node.createLiteral("Hello World!")));
}
示例8: testGenerateEmptyGraphFromSimpleD2RQMapping
import de.fuberlin.wiwiss.d2rq.jena.GraphD2RQ; //导入依赖的package包/类
public void testGenerateEmptyGraphFromSimpleD2RQMapping() {
Mapping m = MappingHelper.readFromTestFile("helpers/simple.ttl");
m.configuration().setServeVocabulary(false);
GraphD2RQ g = new GraphD2RQ(m);
assertTrue(g.isEmpty());
}
示例9: generateDefaultGraphD2RQ
import de.fuberlin.wiwiss.d2rq.jena.GraphD2RQ; //导入依赖的package包/类
private GraphD2RQ generateDefaultGraphD2RQ() {
return new GraphD2RQ(generateDefaultMapping());
}
示例10: setUp
import de.fuberlin.wiwiss.d2rq.jena.GraphD2RQ; //导入依赖的package包/类
protected void setUp() throws Exception {
this.graph = (GraphD2RQ) new ModelD2RQ(D2RQTestSuite.ISWC_MAP, "TURTLE", "http://test/").getGraph();
}
示例11: testCopyPrefixesFromMapModelToD2RQGraph
import de.fuberlin.wiwiss.d2rq.jena.GraphD2RQ; //导入依赖的package包/类
public void testCopyPrefixesFromMapModelToD2RQGraph() {
GraphD2RQ g = new ModelD2RQ(
FileManager.get().loadModel(D2RQTestSuite.DIRECTORY_URL + "prefixes.ttl"), null).getGraph();
assertEquals("http://example.org/", g.getPrefixMapping().getNsPrefixURI("ex"));
}
示例12: getGraph
import de.fuberlin.wiwiss.d2rq.jena.GraphD2RQ; //导入依赖的package包/类
private GraphD2RQ getGraph(Mapping mapping) {
return new GraphD2RQ(mapping);
}