I'll paste enough to repro at the bottom. In short ... I start with some triples in an OntModel create with .createOntologyModel(). They include:
<http://www.basistech.com/ontologies/2010/12/rules#locatedAt> rdfs:subPropertyOf rex:relationship . <uri:jug:taliban#1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> rex:Organization ; <http://www.basistech.com/ontologies/2010/12/rules#locatedAt> <uri:jug:pakistan#1> ; rex:hasNormalizedText "Taliban" . I query with (this is part of an N-way union, and the CONSTRUCT list includes ?s2 ?p ?o) { # start with the triples that have the specified text _:b2 rex:hasNormalizedText "<<<MATCH>>>" . # any subject that can be reached from there by a single relationship step. _:b2 ?pred ?s2 . # where the relationship is defined by one of ours. ?pred rdfs:subPropertyOf* rex:relationship . ?s2 ?p ?o . } and the results includes the following invented triple for the base property. It's more or <uri:jug:taliban#1> <http://www.basistech.com/ontologies/2010/6/rex.owl#relationship> <uri:jug:pakistan#1> . ---------- test data -------------- @prefix x-arq: <urn:x-arq:> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix rex: <http://www.basistech.com/ontologies/2010/6/rex.owl#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . @prefix : <http://www.basistech.com/ontologies/2010/6/rex.owl#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix rex: <http://www.basistech.com/ontologies/2010/6/rex.owl#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . # Turtle file with data for some unit tests. <http://www.basistech.com/ontologies/2010/12/rules#locatedAt> rdfs:subPropertyOf rex:relationship . <uri:jug:taliban#1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> rex:Organization ; <http://www.basistech.com/ontologies/2010/12/rules#locatedAt> <uri:jug:pakistan#1> ; rex:hasNormalizedText "Taliban" ; owl:sameAs <uri:jug:taliban#2> ; owl:sameAs <uri:jug:taliban#3> ; owl:sameAs <uri:jug:staliban#1> . <uri:jug:staliban#1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> rex:Organization ; <http://www.basistech.com/ontologies/2010/12/rules#locatedAt> <uri:jug:pakistan#1> ; rex:hasNormalizedText "STaliban" . <uri:jug:pakistan#1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> rex:Location ; rex:hasNormalizedText "Pakistan" ; rex:hasOriginalText "Pakistan" ; owl:sameAs <uri:jug:x#notIndia> . <uri:jug:x#notIndia> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> rex:Location ; rex:hasNormalizedText "Not India" . <uri:jug:x#someplace> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> rex:Location ; rex:hasNormalizedText "Someplace Else" . <uri:jug:taliban#2> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> rex:Organization ; <http://www.basistech.com/ontologies/2010/12/rules#locatedAt> <uri:jug:x#someplace> ; rex:hasNormalizedText "Taliban" . <uri:jug:taliban#3> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> rex:Organization ; <http://www.basistech.com/ontologies/2010/12/rules#locatedAt> <uri:jug:afghan#1> ; rex:hasNormalizedText "Taliban" . <uri:jug:afghan#1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> rex:Location ; rex:hasNormalizedText "Afghanistan" ; rex:hasOriginalText "Afghanistan" . <uri:jug:unrelated#1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> rex:Person ; rex:hasNormalizedText "Smith" ; rex:hasOriginalText "Smif" .
