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.