view src/de/mpiwg/itgroup/nimanager/persons/IDQueryStringFull @ 6:290d859f036b

ID search
author dwinter
date Thu, 29 Dec 2011 15:20:37 +0100
parents
children
line wrap: on
line source

sparql

select distinct * 
FROM <file://mpiwg_persons_dnb.rdf>  
FROM <file://mpiwg_persons_2.rdf> 
FROM <file:///GND.rdf> 
FROM <http://identifiedNames>
where {{
<%s> <http://xmlns.com/foaf/0.1/name> ?name. 

{{?ident <http://ontologies.mpiwg-berlin.mpg.de/authorities/namedIdentities/identifies_NamedEntity> <%s>. 

?gnd crm:P1_is_identified_by ?ident.} UNION {
?person2 <http://www.w3.org/2002/07/owl#sameAs> <%s>.
?ident2 <http://ontologies.mpiwg-berlin.mpg.de/authorities/namedIdentities/identifies_NamedEntity> ?person2. 
?gnd crm:P1_is_identified_by ?ident2.
}} 

optional {?gnd <http://RDVocab.info/ElementsGr2/dateOfBirth> ?birthDate.}
optional {?gnd <http://RDVocab.info/ElementsGr2/dateOfDeath> ?deathDate.} 

optional { {?gnd <http://www.w3.org/2002/07/owl#sameAs> ?gndSame.}  UNION
{?gndSame <http://www.w3.org/2002/07/owl#sameAs> ?gnd.}}
}

union
 {
?person <http://xmlns.com/foaf/0.1/name> ?name. 

{{?ident <http://ontologies.mpiwg-berlin.mpg.de/authorities/namedIdentities/identifies_NamedEntity> ?person. 

<%s> crm:P1_is_identified_by ?ident.} UNION {
?person2 <http://www.w3.org/2002/07/owl#sameAs> ?person.
?ident2 <http://ontologies.mpiwg-berlin.mpg.de/authorities/namedIdentities/identifies_NamedEntity> ?person2. 
?gndSame crm:P1_is_identified_by ?ident2.
}}

optional {<%s> <http://RDVocab.info/ElementsGr2/dateOfBirth> ?birthDate.}
optional {<%s> <http://RDVocab.info/ElementsGr2/dateOfDeath> ?deathDate.} 

{ {<%s> <http://www.w3.org/2002/07/owl#sameAs> ?gndSame.}  UNION
{?gndSame <http://www.w3.org/2002/07/owl#sameAs> 
<%s>.}}
}
union 

{
?person <http://xmlns.com/foaf/0.1/name> ?name. 

?ident <http://ontologies.mpiwg-berlin.mpg.de/authorities/namedIdentities/identifies_NamedEntity> ?person. 
?gnd crm:P1_is_identified_by ?ident.
?person2 <http://www.w3.org/2002/07/owl#sameAs> ?person.
?ident2 <http://ontologies.mpiwg-berlin.mpg.de/authorities/namedIdentities/identifies_NamedEntity> ?person2. 
<%s> crm:P1_is_identified_by ?ident2.


optional {?gnd <http://RDVocab.info/ElementsGr2/dateOfBirth> ?birthDate.}
optional {?gnd <http://RDVocab.info/ElementsGr2/dateOfDeath> ?deathDate.} 

optional { {?gnd <http://www.w3.org/2002/07/owl#sameAs> ?gndSame.}  UNION
{?gndSame <http://www.w3.org/2002/07/owl#sameAs> ?gnd.}}
}
}