/** * Build an inferred model by attaching the given RDF model to the given reasoner. * This form of the call allows two data sets to be merged and reasoned over - * conventionally one contains schema data and one instance data but this is not * a formal requirement. * * @param reasoner the reasoner to use to process the data * @param schema a Model containing RDFS schema data * @param model a Model containing instance data assertions, any statements added to the InfModel * will be added to this underlying data model. */ public static InfModel createInfModel(Reasoner reasoner, Model schema, Model model) { InfGraph graph = reasoner.bindSchema(schema.getGraph()).bind(model.getGraph()); return new InfModelImpl( graph ); }
/** * 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; }
/** * Test the capabilities description. */ public void testRDFSDescription() { ReasonerFactory rf = RDFSFBRuleReasonerFactory.theInstance(); Reasoner r = rf.create(null); assertTrue(r.supportsProperty(RDFS.subClassOf)); assertTrue(r.supportsProperty(RDFS.domain)); assertTrue( ! r.supportsProperty(OWL.allValuesFrom)); }
/** * Build an inferred model by attaching the given RDF model to the given reasoner. * * @param reasoner the reasoner to use to process the data * @param model the Model containing both instance data and schema assertions to be inferenced over, * any statements added to the InfModel will be added to this underlying data model. */ public static InfModel createInfModel( Reasoner reasoner, Model model ) { InfGraph graph = reasoner.bind(model.getGraph()); return new InfModelImpl(graph); }
@Override public Reasoner create( Resource configuration ) { return rf.create( configuration ).bindSchema( schema ); }
data.add( new Triple(C2, RDFS.subClassOf.asNode(), C3) ); Reasoner reasoner = TransitiveReasonerFactory.theInstance().create(null); assertTrue(reasoner.supportsProperty(RDFS.subClassOf)); assertTrue(! reasoner.supportsProperty(RDFS.domain)); InfGraph infgraph = reasoner.bind(data); TestUtil.assertIteratorValues(this, infgraph.find(C1, null, null),
if (om.getReasoner() != null) { if (om.getReasoner() .getReasonerCapabilities().contains( null, ReasonerVocabulary.supportsP, RDFS.subClassOf ))
/** Answer the InfCapabilities of this InfGraph. */ @Override public Capabilities getCapabilities() { if (capabilities == null) { return getReasoner().getGraphCapabilities(); } else { return capabilities; } }
/** * Build an inferred model by attaching the given RDF model to the given reasoner. * * @param reasoner the reasoner to use to process the data * @param model the Model containing both instance data and schema assertions to be inferenced over, * any statements added to the InfModel will be added to this underlying data model. */ public static InfModel createInfModel( Reasoner reasoner, Model model ) { InfGraph graph = reasoner.bind(model.getGraph()); return new InfModelImpl(graph); }
@Override public Reasoner create( Resource configuration ) { return rf.create( configuration ).bindSchema( schema ); }
data.add( new Triple(C2, RDFS.subClassOf.asNode(), C3) ); Reasoner reasoner = TransitiveReasonerFactory.theInstance().create(null); assertTrue(reasoner.supportsProperty(RDFS.subClassOf)); assertTrue(! reasoner.supportsProperty(RDFS.domain)); InfGraph infgraph = reasoner.bind(data); TestUtil.assertIteratorValues(this, infgraph.find(C1, null, null),
if (om.getReasoner() != null) { if (om.getReasoner() .getReasonerCapabilities().contains( null, ReasonerVocabulary.supportsP, RDFS.subClassOf ))
/** Answer the InfCapabilities of this InfGraph. */ @Override public Capabilities getCapabilities() { if (capabilities == null) { return getReasoner().getGraphCapabilities(); } else { return capabilities; } }
/** * Build an inferred model by attaching the given RDF model to the given reasoner. * This form of the call allows two data sets to be merged and reasoned over - * conventionally one contains schema data and one instance data but this is not * a formal requirement. * * @param reasoner the reasoner to use to process the data * @param schema a Model containing RDFS schema data * @param model a Model containing instance data assertions, any statements added to the InfModel * will be added to this underlying data model. */ public static InfModel createInfModel(Reasoner reasoner, Model schema, Model model) { InfGraph graph = reasoner.bindSchema(schema.getGraph()).bind(model.getGraph()); return new InfModelImpl( graph ); }
/** * Return a Model through which all the RDFS entailments * derivable from the given model are accessible. Some work is done * when the inferenced model is created but each query will also trigger some * additional inference work. * * @param model the Model containing both instance data and schema assertions to be inferenced over */ public static InfModel createRDFSModel(Model model) { Reasoner reasoner = ReasonerRegistry.getRDFSReasoner(); InfGraph graph = reasoner.bind( model.getGraph() ); return new InfModelImpl( graph ); }
/** Answer a Reasoner created according to the underlying factory, and then loaded with this Wrapper's rules (if the Reasoner is a RuleReasoner) and bound to this Wrapper's schemas (in an unspecified order). */ @Override public Reasoner create( Resource ignored ) { Reasoner result = factory.create( config ); return schemaUnion.isEmpty() ? result : result.bindSchema( schemaUnion ); }
/** * Test the capabilities description. */ public void testRDFSDescription() { ReasonerFactory rf = RDFSFBRuleReasonerFactory.theInstance(); Reasoner r = rf.create(null); assertTrue(r.supportsProperty(RDFS.subClassOf)); assertTrue(r.supportsProperty(RDFS.domain)); assertTrue( ! r.supportsProperty(OWL.allValuesFrom)); }
/** * 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; }
if (getGraph() instanceof InfGraph) { supportsIndAsThing = ((InfGraph) getGraph()).getReasoner() .getReasonerCapabilities() .contains( null, ReasonerVocabulary.supportsP, ReasonerVocabulary.individualAsThingP );
/** * Return a Model through which all the RDFS entailments * derivable from the given data and schema models are accessible. * There is no strict requirement to separate schema and instance data between the two * arguments. * * @param model a Model containing instance data assertions * @param schema a Model containing RDFS schema data */ public static InfModel createRDFSModel( Model schema, Model model ) { Reasoner reasoner = ReasonerRegistry.getRDFSReasoner(); InfGraph graph = reasoner.bindSchema(schema.getGraph()).bind(model.getGraph()); return new InfModelImpl( graph ); }