clear
load /Users/fabio/projects/open-ontologies/case-studies/heritage-aerial/ontology/naph-core.ttl
load /Users/fabio/projects/open-ontologies/case-studies/heritage-aerial/data/sample-photographs.ttl
query "PREFIX naph: <https://w3id.org/naph/ontology#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> SELECT ?photo ?label ?date WHERE { ?photo a naph:AerialPhotograph ; rdfs:label ?label ; naph:capturedOn ?date . FILTER (?date >= \"1939-09-01\"^^xsd:date && ?date <= \"1945-09-02\"^^xsd:date) } ORDER BY ?date"
query "PREFIX naph: <https://w3id.org/naph/ontology#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT ?photo ?label ?rightsLabel WHERE { ?photo a naph:AerialPhotograph ; rdfs:label ?label ; naph:hasRightsStatement ?rights . ?rights naph:rightsLabel ?rightsLabel ; naph:rightsURI ?rightsURI . FILTER (CONTAINS(STR(?rightsURI), \"NoC\") || CONTAINS(STR(?rightsURI), \"publicdomain\")) }"
query "PREFIX naph: <https://w3id.org/naph/ontology#> PREFIX skos: <http://www.w3.org/2004/02/skos/core#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT ?photo ?label ?wikidata WHERE { ?photo a naph:AerialPhotograph ; rdfs:label ?label ; naph:relatedToEvent ?event . ?event a naph:HistoricEvent ; skos:exactMatch ?wikidata . FILTER (CONTAINS(STR(?wikidata), \"wikidata.org\")) }"
query "PREFIX naph: <https://w3id.org/naph/ontology#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT ?photo ?label ?chainLabel WHERE { ?photo a naph:AerialPhotograph ; rdfs:label ?label ; naph:hasProvenanceChain ?chain . ?chain rdfs:label ?chainLabel . FILTER (CONTAINS(?chainLabel, \"NARA\")) }"
query "PREFIX naph: <https://w3id.org/naph/ontology#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT ?tierLabel (COUNT(?photo) AS ?count) WHERE { ?photo naph:compliesWithTier ?tier . ?tier rdfs:label ?tierLabel . } GROUP BY ?tierLabel ORDER BY DESC(?count)"
query "PREFIX naph: <https://w3id.org/naph/ontology#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT ?photo ?label ?altitude WHERE { ?photo a naph:AerialPhotograph ; rdfs:label ?label ; naph:partOfSortie ?sortie ; naph:hasCaptureEvent ?capture . ?sortie naph:aircraft ?aircraft . ?capture naph:flightAltitude ?altitude . FILTER (CONTAINS(?aircraft, \"Spitfire\")) FILTER (?altitude >= 6000.0) }"
query "PREFIX naph: <https://w3id.org/naph/ontology#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> SELECT DISTINCT ?photo ?label WHERE { ?photo a naph:AerialPhotograph ; rdfs:label ?label ; naph:capturedOn ?date ; naph:depicts ?place ; naph:hasRightsStatement ?rights . ?place a naph:Place . ?rights naph:rightsURI ?rightsURI . FILTER (?date >= \"1944-01-01\"^^xsd:date) FILTER (CONTAINS(STR(?rightsURI), \"NoC\") || CONTAINS(STR(?rightsURI), \"publicdomain\")) }"
