/** * Return a prebuilt standard configuration for the default RDFS reasoner */ public static Reasoner getRDFSReasoner() { if (theRDFSReasoner == null) theRDFSReasoner = RDFSRuleReasonerFactory.theInstance().create(null); return theRDFSReasoner; }
/** * Return a prebuilt standard configuration for the default RDFS reasoner */ public static Reasoner getRDFSReasoner() { if (theRDFSReasoner == null) theRDFSReasoner = RDFSRuleReasonerFactory.theInstance().create(null); return theRDFSReasoner; }
/** * Return a prebuilt simplified configuration for the default RDFS reasoner */ public static Reasoner getRDFSSimpleReasoner() { if (theRDFSSimpleReasoner == null) { theRDFSSimpleReasoner = RDFSRuleReasonerFactory.theInstance().create(null); theRDFSSimpleReasoner.setParameter(ReasonerVocabulary.PROPsetRDFSLevel, ReasonerVocabulary.RDFS_SIMPLE); } return theRDFSSimpleReasoner; }
/** * Return a prebuilt simplified configuration for the default RDFS reasoner */ public static Reasoner getRDFSSimpleReasoner() { if (theRDFSSimpleReasoner == null) { theRDFSSimpleReasoner = RDFSRuleReasonerFactory.theInstance().create(null); theRDFSSimpleReasoner.setParameter(ReasonerVocabulary.PROPsetRDFSLevel, ReasonerVocabulary.RDFS_SIMPLE); } return theRDFSSimpleReasoner; }
/** * Run test on findWithPremies for RDFS reasoner. */ public void testRDFSFindWithPremises() { doTestFindWithPremises(RDFSRuleReasonerFactory.theInstance()); }
/** * Test metalevel add/remove subproperty operations for rdsf reasoner. */ public void testRDFSMetaLevel() { doTestMetaLevel(RDFSRuleReasonerFactory.theInstance()); }
/** * Run test on findWithPremies for RDFS reasoner. */ public void testRDFSFindWithPremises() { doTestFindWithPremises(RDFSRuleReasonerFactory.theInstance()); }
/** * Test metalevel add/remove subproperty operations for rdsf reasoner. */ public void testRDFSMetaLevel() { doTestMetaLevel(RDFSRuleReasonerFactory.theInstance()); }
/** * Test a single RDFS case. */ public void hiddenTestRDFSReasonerDebug() throws IOException { ReasonerTester tester = new ReasonerTester("rdfs/manifest-nodirect-noresource.rdf"); ReasonerFactory rf = RDFSRuleReasonerFactory.theInstance(); assertTrue("RDFS hybrid-tgc reasoner test", tester.runTest("http://www.hpl.hp.com/semweb/2003/query_tester/rdfs/test11", rf, this, null)); }
/** * Test the basic functioning of the hybrid RDFS rule reasoner with TGC cache */ public void testRDFSExptReasoner() throws IOException { ReasonerTester tester = new ReasonerTester("rdfs/manifest-nodirect-noresource.rdf"); ReasonerFactory rf = RDFSRuleReasonerFactory.theInstance(); assertTrue("RDFS experimental (hybrid+tgc) reasoner tests", tester.runTests(rf, this, null)); }
/** * Test a single RDFS case. */ public void hiddenTestRDFSReasonerDebug() throws IOException { ReasonerTester tester = new ReasonerTester("rdfs/manifest-nodirect-noresource.rdf"); ReasonerFactory rf = RDFSRuleReasonerFactory.theInstance(); assertTrue("RDFS hybrid-tgc reasoner test", tester.runTest("http://www.hpl.hp.com/semweb/2003/query_tester/rdfs/test11", rf, this, null)); }
/** * Test the basic functioning of the hybrid RDFS rule reasoner with TGC cache */ public void testRDFSExptReasoner() throws IOException { ReasonerTester tester = new ReasonerTester("rdfs/manifest-nodirect-noresource.rdf"); ReasonerFactory rf = RDFSRuleReasonerFactory.theInstance(); assertTrue("RDFS experimental (hybrid+tgc) reasoner tests", tester.runTests(rf, this, null)); }
private Model createForwardChainingModel() { Model baseModel = ModelFactory.createDefaultModel(); Model schemaModel = ModelFactory.createDefaultModel(); Model configurationRuleReasoner = ModelFactory.createDefaultModel(); org.apache.jena.rdf.model.Resource configuration = configurationRuleReasoner.createResource(); configuration.addProperty(ReasonerVocabulary.PROPruleMode, "forward"); configuration.addProperty(ReasonerVocabulary.PROPsetRDFSLevel, ReasonerVocabulary.RDFS_SIMPLE); Reasoner ruleReasoner = RDFSRuleReasonerFactory.theInstance().create(configuration); InfModel inf = ModelFactory.createInfModel(ruleReasoner, schemaModel, baseModel); inf.read(new ByteArrayInputStream(TURTLE_RDF.getBytes()), "", "TURTLE"); return inf; }
/** * Constructor is hidden - go via theRegistry */ private ReasonerRegistry() { allDescriptions = ModelFactory.createDefaultModel(); // Preload the known Jena reasoners register(TransitiveReasonerFactory.theInstance()); register(RDFSRuleReasonerFactory.theInstance()); register(OWLFBRuleReasonerFactory.theInstance()); register(GenericRuleReasonerFactory.theInstance()); register(OWLMicroReasonerFactory.theInstance()); register(OWLMiniReasonerFactory.theInstance()); }
/** * Constructor is hidden - go via theRegistry */ private ReasonerRegistry() { allDescriptions = ModelFactory.createDefaultModel(); // Preload the known Jena reasoners register(TransitiveReasonerFactory.theInstance()); register(RDFSRuleReasonerFactory.theInstance()); register(OWLFBRuleReasonerFactory.theInstance()); register(GenericRuleReasonerFactory.theInstance()); register(OWLMicroReasonerFactory.theInstance()); register(OWLMiniReasonerFactory.theInstance()); }
@Override protected void runTest() throws IOException { int rslt = WGReasonerTester.FAIL; try { JenaParameters.enableWhitespaceCheckingOfTypedLiterals = true; Resource config = ModelFactory.createDefaultModel().createResource() .addProperty(ReasonerVocabulary.PROPsetRDFSLevel, "full"); rslt = wgReasoner.runTestDetailedResponse(testID.getURI(), RDFSRuleReasonerFactory.theInstance(),this,config); } finally { logResult(testID,rslt); } // assertTrue(rslt>=0); } /* (non-Javadoc)
@Override protected void runTest() throws IOException { int rslt = WGReasonerTester.FAIL; try { JenaParameters.enableWhitespaceCheckingOfTypedLiterals = true; Resource config = ModelFactory.createDefaultModel().createResource() .addProperty(ReasonerVocabulary.PROPsetRDFSLevel, "full"); rslt = wgReasoner.runTestDetailedResponse(testID.getURI(), RDFSRuleReasonerFactory.theInstance(),this,config); } finally { logResult(testID,rslt); } // assertTrue(rslt>=0); } /* (non-Javadoc)
private void doTestRDFSSimple(String level) { Model model = ModelFactory.createDefaultModel(); String NS = "http://jena.hpl.hp.com/example#"; Property prop = model.createProperty(NS + "prop"); model.add(prop, RDF.type, RDF.Property); Reasoner reasoner = RDFSRuleReasonerFactory.theInstance().create(null); reasoner.setParameter(ReasonerVocabulary.PROPsetRDFSLevel, level); InfModel im = ModelFactory.createInfModel(reasoner, model); assertTrue( im.contains(prop, RDFS.subPropertyOf, prop) ); }
private void doTestRDFSSimple(String level) { Model model = ModelFactory.createDefaultModel(); String NS = "http://jena.hpl.hp.com/example#"; Property prop = model.createProperty(NS + "prop"); model.add(prop, RDF.type, RDF.Property); Reasoner reasoner = RDFSRuleReasonerFactory.theInstance().create(null); reasoner.setParameter(ReasonerVocabulary.PROPsetRDFSLevel, level); InfModel im = ModelFactory.createInfModel(reasoner, model); assertTrue( im.contains(prop, RDFS.subPropertyOf, prop) ); }
private static void testInfModel(Dataset ds0) { Txn.executeWrite(ds0, ()->{}); Model baseModel = ds0.getDefaultModel(); Model model = ModelFactory.createInfModel(RDFSRuleReasonerFactory.theInstance().create(null), baseModel); if ( model.getGraph().getTransactionHandler().transactionsSupported() ) { // InfModels do not support transactions per se - they particpate if includes in a suitabel dataset. model.begin(); long x = Iter.count(model.listStatements()); model.commit(); assertTrue(x > 10); } }