matthiasluehr / VIVO-HSMW

2 stars 0 forks source link

Query Kober #7

Open matthiasluehr opened 2 years ago

matthiasluehr commented 2 years ago

PREFIX core: http://vivoweb.org/ontology/core# PREFIX rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns# PREFIX rdfs: http://www.w3.org/2000/01/rdf-schema# PREFIX xsd: http://www.w3.org/2001/XMLSchema# PREFIX foaf: http://xmlns.com/foaf/0.1/ PREFIX hsmw: https://vivo.hs-mittweida.de/vivo/ontology/hsmw# PREFIX kdsf: http://kerndatensatz-forschung.de/owl/Basis# PREFIX vivo: http://vivoweb.org/ontology/core# PREFIX vivo-de: http://vivoweb.org/ontology/core/de# PREFIX obo: http://purl.obolibrary.org/obo/ PREFIX bibo: http://purl.org/ontology/bibo/

SELECT YEAR(?start) YEAR(?end) (CONCAT(?akadgrad, " ", ?name) AS ?fullname) ?title ?drittmittelgeber ?kooppartner { ?personUri http://vitro.mannlib.cornell.edu/ns/vitro/authorization#externalAuthId "tolkmitt" . ?personUri http://purl.obolibrary.org/obo/RO_0000053 ?pirole . ?personUri rdfs:label ?name . ?personUri obo:ARG_2000028 ?vcard . ?vcard a http://www.w3.org/2006/vcard/ns#Kind . ?vcard http://www.w3.org/2006/vcard/ns#hasTitle ?titlenode . ?titlenode a http://www.w3.org/2006/vcard/ns#Title . ?titlenode http://www.w3.org/2006/vcard/ns#title ?akadgrad .

?pirole a http://vivoweb.org/ontology/core#PrincipalInvestigatorRole . ?pirole http://vivoweb.org/ontology/core#relatedBy ?project . ?project a http://kerndatensatz-forschung.de/owl/Basis#Drittmittelprojekt . ?project rdfs:label ?title . ?project http://vivoweb.org/ontology/core#dateTimeInterval ?dti . ?dti http://vivoweb.org/ontology/core#start ?startnode . ?dti http://vivoweb.org/ontology/core#end ?endnode . ?startnode http://vivoweb.org/ontology/core#dateTime ?start . ?endnode http://vivoweb.org/ontology/core#dateTime ?end . OPTIONAL { ?project vivo:assignedBy ?dmg . ?dmg a foaf:Organization . ?dmg rdfs:label ?drittmittelgeber . } OPTIONAL { ?project vivo-de:kooperationspartner ?koop . ?koop a foaf:Organization . ?koop rdfs:label ?kooppartner . } FILTER (?end >= "2019-01-01T00:00:00"^^http://www.w3.org/2001/XMLSchema#dateTime) FILTER (?start <= "2019-12-31T00:00:00"^^http://www.w3.org/2001/XMLSchema#dateTime) } ORDER BY ?start

matthiasluehr commented 1 year ago

Version 2:

PREFIX vivo: <http://vivoweb.org/ontology/core#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX obo:      <http://purl.obolibrary.org/obo/>
PREFIX foaf:    <http://xmlns.com/foaf/0.1/>
PREFIX hsmw:     <https://vivo.hs-mittweida.de/vivo/ontology/hsmw#>
PREFIX vitro: <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#>
PREFIX vivo-de: <http://vivoweb.org/ontology/core/de#>

SELECT (SAMPLE(?start) AS ?s)
(SAMPLE(?end) AS ?e)
(CONCAT(SAMPLE(?akadgrad), " ", SAMPLE(?name)) AS ?fullname)
(SAMPLE(?title) AS ?t)
(SAMPLE(?projno) AS ?pronumber)
(GROUP_CONCAT(?drittmittelgeber; SEPARATOR=";") AS ?dg) 
(GROUP_CONCAT(?kooppartner; SEPARATOR=";") AS ?ko) WHERE {
?personUri <http://vitro.mannlib.cornell.edu/ns/vitro/authorization#externalAuthId> "haeussle" .
?personUri <http://purl.obolibrary.org/obo/RO_0000053> ?pirole .
?personUri rdfs:label ?name .
?personUri obo:ARG_2000028 ?vcard .
?vcard a <http://www.w3.org/2006/vcard/ns#Kind> .
?vcard <http://www.w3.org/2006/vcard/ns#hasTitle> ?titlenode .
?titlenode a <http://www.w3.org/2006/vcard/ns#Title> .
?titlenode <http://www.w3.org/2006/vcard/ns#title> ?akadgrad .

?pirole a <http://vivoweb.org/ontology/core#PrincipalInvestigatorRole> .
?pirole <http://vivoweb.org/ontology/core#relatedBy> ?project .
?project a <http://kerndatensatz-forschung.de/owl/Basis#Drittmittelprojekt> .
?project rdfs:label ?title .
?project <https://vivo.hs-mittweida.de/vivo/ontology/hsmw#hsmwprojectno>  ?projno .
?project <http://vivoweb.org/ontology/core#dateTimeInterval> ?dti .
?dti <http://vivoweb.org/ontology/core#start> ?startnode .
?dti <http://vivoweb.org/ontology/core#end> ?endnode .
?startnode <http://vivoweb.org/ontology/core#dateTime> ?start .
?endnode <http://vivoweb.org/ontology/core#dateTime> ?end .
OPTIONAL {
?project vivo:assignedBy ?dmg .
?dmg a foaf:Organization .
?dmg rdfs:label ?drittmittelgeber .
}
  OPTIONAL {
?project vivo-de:kooperationspartner ?koop .
?koop a foaf:Organization .
?koop rdfs:label ?kooppartner .
}
FILTER (?end >= "2019-01-01T00:00:00"^^<http://www.w3.org/2001/XMLSchema#dateTime>)
FILTER (?start < "2021-01-01T00:00:00"^^<http://www.w3.org/2001/XMLSchema#dateTime>)  
}
GROUP BY ?project