@Override public Reasoner create( Resource configuration ) { return rf.create( configuration ).bindSchema( schema ); }
/** 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 ); }
/** * 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 ); }
Reasoner reasoner = ReasonerRegistry.getRDFSSimpleReasoner().bindSchema(schema); InfModel inf = ModelFactory.createInfModel(reasoner, config);
/** * 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 ); }
Reasoner reasoner = ReasonerRegistry.getOWLReasoner(); reasoner = reasoner.bindSchema(schema1); Reasoner reasonerAll = ReasonerRegistry.getOWLReasoner(); reasonerAll.bindSchema(allSchemas);
public static void testData(String dataF, String schemaF) { Model schema = FileManager.get().loadModel(schemaF); Reasoner reasoner = ReasonerRegistry.getOWLReasoner(); reasoner.bindSchema(schema); Model data = FileManager.get().loadModel(dataF); InfModel model = ModelFactory.createInfModel(reasoner, data); ValidityReport rep = model.validate(); getValidityOutput(rep); Resource res = model.getResource("http://www.semanticweb.org/ontologies/2013/8/untitled-ontology-45#Image1"); System.out.println("Image types:"); printStatements(model, res, RDF.type, null); }