[Sorry, missed this when it first came in.] On 13/08/16 23:52, Simon Schäfer wrote:
---- On Mon, 08 Aug 2016 22:47:35 +0200 Dave Reynolds <[email protected]> wrote ---- > > The RDFS and (useful subsets of) OWL semantics are provided by the > building reasoner configurations - no need to write your own rules for > those. I managed to build an example that is doing what I want. I simply used the RDFS model like this: model = ModelFactory.createRDFSModel(ModelFactory.createDefaultModel()) model.getReasoner().setParameter(ReasonerVocabulary.PROPsetRDFSLevel, ReasonerVocabulary.RDFS_SIMPLE) model.getReasoner().setParameter(ReasonerVocabulary.PROPruleMode, "backward") And I configured the data like this: prefix sd:<http://x.test/schema/Decl/0.1/> prefix sc:<http://x.test/schema/Class/0.1/> prefix c:<http://x.test/data/Class/0.1/> prefix rdfs:<http://www.w3.org/2000/01/rdf-schema#> prefix s:<http://schema.org/> insert data { sc: rdfs:subClassOf sd: . sd:name rdfs:subPropertyOf s:name . sc:name rdfs:subPropertyOf sd:name . c:ClassName a sc: . c:ClassName sc:name "ClassName" . } The name is inserted as "sc:name" but I can write a query that asks for "sd:name" or "s:name" and it finds the name (which is what I want). Btw, how is the data now stored on disk? When I do a "select * where {?s ?p ?o}" the query shows that the name is three times available, one time for each property. Is it also stored three times on disk or just once and the reasoner the values once the query is executed?
Nothing is stored on disk in that snippet, looks like it's all running in memory.
Even if your real base model the data were on disk the reasoner information would still be in memory.
Since you have forced the reasoner into backward mode then it'll be dynamically recreating the information on the fly in response to each query.
Dave
