My slight variation on your last reply returns all tuples in the data
with arq. Query:

REFIX rex:   <http://www.basistech.com/ontologies/2010/6/rex.owl#>
PREFIX owl:   <http://www.w3.org/2002/07/owl#>
PREFIX x-arq: <urn:x-arq:>
PREFIX rdfs:  <http://www.w3.org/2000/01/rdf-schema#>

CONSTRUCT{
  ?s ?p ?o .
  ?root rex:root "true"
}
WHERE
{
      { ?root rex:hasNormalizedText "Taliban" }
      UNION
      { ?s rex:hasNormalizedText "Taliban" }
      UNION
      { ?entity rex:hasNormalizedText "Taliban" .
        ?s (owl:sameAs|^owl:sameAs)* ?entity .
      }
      UNION
      {
        ?entity rex:hasNormalizedText "Taliban" .
        ?entity ?pred ?s .
        ?pred rdfs:subPropertyOf* rex:relationship .
      }
      UNION
      {
        ?entity rex:hasNormalizedText "Taliban" .
        ?entity (owl:sameAs|^owl:sameAs)* ?t .
        ?t ?pred ?s .
        ?pred rdfs:subPropertyOf* rex:relationship .
      }
      UNION
      {
        ?entity rex:hasNormalizedText "Taliban" .
        ?entity ?pred ?t .
        ?pred rdfs:subPropertyOf* rex:relationship .
        ?t (owl:sameAs|^owl:sameAs)* ?s .
      }
      ?s ?p ?o .
}


---------------- 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#> .

<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> .

<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" .

Reply via email to