Hack-a-LOD

9 Februari, 2018

🌐 De wereld rond met Linked Data van het Nationaal Archief

đŸ“Ŋ ÉÊn film


prefix film: <http://na.metamatter.nl/NadereToegang/resource/Filmkeuring/>
select ?p ?o {
  film:Film39371 ?p ?o .
}
limit 100
            

🎞 Elke film heeft een lengte


prefix def: <http://na.metamatter.nl/NadereToegangen/ontology/>
prefix xsd: <http://www.w3.org/2001/XMLSchema#>
select ?film ?lengte {
  ?film def:mediumLength ?string .
  bind (xsd:float(replace(?string, " meter$", "")) as ?lengte)
}
limit 10
            

🎞 Hoe veel kilometer film is er?


prefix def: 
prefix xsd: 
select (sum(?length) / 1000 as ?sum) {
  ?film def:mediumLength ?string .
  bind (xsd:float(replace(?string, " meter$", "")) as ?length)
}
            

đŸ—ē Hoe vaak kunnen we met film de wereld rond?


prefix dbp: <http://dbpedia.org/property/>
prefix dbr: <http://dbpedia.org/resource/>
prefix def: <http://na.metamatter.nl/NadereToegangen/ontology/>
prefix xsd: <http://www.w3.org/2001/XMLSchema#>
select ?rondjes {
  {select (sum(?length) as ?sum) {
    ?film def:mediumLength ?string .
    bind (xsd:float(replace(?string, " meter$", "")) as ?length)
  }}
  service <http://dbpedia.org/sparql> {select ?circumference {
    dbr:Earth dbp:circumference	?x .
    bind (xsd:float(?x) * 1000 as ?circumference)
  } limit 1}
  bind (?sum / ?circumference as ?rondjes)
}
            
prefix xsd: select ?sum ?circumference ?trips { {select (sum(?length) as ?sum) { ?s ?string . bind (xsd:float(replace(?string, " meter$", "")) as ?length) }} service {select ?circumference { ?x . bind (xsd:float(?x) * 1000 as ?circumference) } limit 1} bind (?sum / ?circumference as ?trips) }