1

I stored triples in Marklogic. I would like to infer them to get a fact in which instances which have owl:sameAs relation to other instances are described, by using an ontology which has a haskey restriction as follows.

[Stored triples to infere]

ex:01   rdf:type ex:Student;
        foaf:name "Bill Clinton";
        ex:hasID "042".
ex:02   rdf:type ex:Student;
        foaf:name "George Walker Bush";
        ex:hasID "043".
ex:03   rdf:type ex:Student;
        foaf:name "Donald John Trump";
        ex:hasID "045".
ex:04   rdf:type ex:Student;
        foaf:name "Barack Hussein Obama II";
        ex:hasID "044".
ex:05   rdf:type ex:Student;
        foaf:name "William Jefferson Clinton";
        ex:hasID "042".
ex:06   rdf:type ex:Student;
        foaf:name "Don Trump";
        ex:hasID "045".

[Ontology]

foaf:name rdf:type owl:DatatypeProperty.
ex:hasId rdf:type owl:DatatypeProperty.
ex:Student rdf:type owl:Class ;
           owl:hasKey ( ex:hasId
                      ) .

[Fact - expected result of inference]

ex:01 owl:sameAs ex:05.
ex:03 owl:sameAs ex:06.
ex:05 owl:sameAs ex:01.
ex:06 owl:sameAs ex:03.

How do I make Marklogic work to infer? Incidentally, my Marklogic's version is 10.

1 Answers1

1

owl:hasKey was introduced in OWL 2. MarkLogic doesn't provide Rules for OWL 2 out of the box (yet). You can create it yourself. The Inference guide explains how Rules work in MarkLogic:

https://docs.marklogic.com/10.0/guide/semantics/inferencing#id_46963

HTH!

grtjn
  • 20,254
  • 1
  • 24
  • 35
  • Thanks! I read the page you showed and understood. Is it possible to combine Marklogic and any resoner for example Pellet ? Do you know what the best selection of reasoner for Marklogic is if it is so? – Hisashi Sakai Jul 07 '20 at 07:41
  • I don't think you would gain much if you tried. Pellet runs in Java, so must be run outside of MarkLogic, which means you would loose a lot of performance on your SPARQL Queries. I'd recommend looking for existing OWL 2 rulesets, and rewriting them to MarkLogic Rules files, or just writing the ones you need yourself. – grtjn Jul 08 '20 at 06:26
  • Another option might be to do inferencing before loading into MarkLogic, and materializing the inferred triples as real triples inside MarkLogic. That would give best performance, at the cost of some flexibility. – grtjn Jul 08 '20 at 06:28
  • Thank you! I understood using a reasoner which works outdside of Marklogic isn't good choice. I will try to look for OWL2 rulesets or write it according to your advice. – Hisashi Sakai Jul 10 '20 at 14:53