SPARQL query
Copy query
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX dct: <http://purl.org/dc/terms/>
PREFIX np: <http://www.nanopub.org/nschema#>
PREFIX npa: <http://purl.org/nanopub/admin/>
PREFIX npx: <http://purl.org/nanopub/x/>
PREFIX nt: <https://w3id.org/np/o/ntemplate/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>
PREFIX dcat: <http://www.w3.org/ns/dcat#>
SELECT DISTINCT
?np
?label
?intention
?timenode
?startTime
?endTime
?geoID
?ecoID
?ecoIDLabel
?materialID
?materialIDLabel
?orcid
WHERE {
GRAPH npa:graph {
?np npa:hasValidSignatureForPublicKey ?pubkey .
FILTER NOT EXISTS {
?npx npx:invalidates ?np ;
npa:hasValidSignatureForPublicKey ?pubkey .
}
?np dct:created ?date ;
np:hasAssertion ?assertion ;
np:hasProvenance ?provenance ;
np:hasPublicationInfo ?pubinfo .
OPTIONAL {
?np rdfs:label ?label .
}
}
FILTER NOT EXISTS {
?np a <http://purl.org/nanopub/x/DraftNanopub> .
}
GRAPH ?assertion {
?intention a <https://w3id.org/spaces/biodiversity/r/ontology/samplingIntention> .
OPTIONAL {
?intention
<https://w3id.org/sciencelive/o/terms/coversTimePeriod>
?timenode .
OPTIONAL {
?timenode dcat:temporalStartDate ?startTime .
}
OPTIONAL {
?timenode dcat:temporalEndDate ?endTime .
}
}
OPTIONAL {
?intention
<https://w3id.org/spaces/biodiversity/r/ontology/hasSamplingLocation>
?locationNode .
OPTIONAL {
?locationNode geo:location ?geoID .
}
OPTIONAL {
?locationNode rdf:type ?ecoID .
}
}
OPTIONAL {
?intention
<https://w3id.org/spaces/biodiversity/r/ontology/hasSampleMaterial>
?materialNode .
OPTIONAL {
?materialNode rdf:type ?materialID .
}
}
}
OPTIONAL {
GRAPH ?pubinfo {
?ecoID nt:hasLabelFromApi ?ecoIDLabel .
}
}
OPTIONAL {
GRAPH ?pubinfo {
?materialID nt:hasLabelFromApi ?materialIDLabel .
}
}
OPTIONAL {
GRAPH ?provenance {
?assertion prov:wasAttributedTo ?orcid .
}
}
}