Advertisement
Guest User

Untitled

a guest
Oct 2nd, 2019
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SPARQL 2.06 KB | None | 0 0
  1. PREFIX dbo: <http://dbpedia.org/ontology/>
  2. SELECT DISTINCT ?Astronaut ?Astronaut_Label WHERE {
  3.     ?Astronaut rdf:type dbo:Astronaut.
  4.     ?Astronaut rdfs:label ?Astronaut_Label
  5.     FILTER((LANGMATCHES(LANG(?Astronaut_Label), "en")) && (LANGMATCHES(LANG(?Astronaut_Label), "en")))
  6. }
  7.  
  8.  
  9. PREFIX dbo: <http://dbpedia.org/ontology/>
  10. SELECT COUNT(*) {
  11.     SELECT DISTINCT ?Astronaut ?Astronaut_Label WHERE {
  12.         ?Astronaut rdf:type dbo:Astronaut.
  13.         ?Astronaut rdfs:label ?Astronaut_Label
  14.         FILTER((LANGMATCHES(LANG(?Astronaut_Label), "en")) && (LANGMATCHES(LANG(?Astronaut_Label), "en")))
  15.     }
  16. }
  17.  
  18.  
  19. PREFIX dbo: <http://dbpedia.org/ontology/>
  20. PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
  21. SELECT DISTINCT ?astronaut ?astronaut_Label ?country ?country_Label
  22. WHERE {
  23.     ?astronaut a dbo:Astronaut.
  24.     ?astronaut rdfs:label ?astronaut_Label.
  25.     ?astronaut dbo:birthPlace ?country.
  26.     ?country a dbo:Country.
  27.     ?country rdfs:label ?country_Label.
  28.     FILTER((LANGMATCHES(LANG(?astronaut_Label), "en")) && (LANGMATCHES(LANG(?astronaut_Label), "en")))
  29.     FILTER((LANGMATCHES(LANG(?country_Label), "en")) && (LANGMATCHES(LANG(?country_Label), "en")) && ((STR(?country_Label)) = "United States"))
  30. }
  31.  
  32.  
  33. PREFIX dbo: <http://dbpedia.org/ontology/>
  34. PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
  35. SELECT DISTINCT
  36. ?astronaut ?astronaut_Label ?country ?country_Label ?city ?city_Label
  37. WHERE{
  38.     ?astronaut a dbo:Astronaut.
  39.     ?astronaut rdfs:label ?astronaut_Label.
  40.     ?astronaut dbo:birthPlace ?country.
  41.     ?astronaut dbo:birthPlace ?city.
  42.     ?country a dbo:Country.
  43.     ?country rdfs:label ?country_Label.
  44.     ?city a dbo:City.
  45.     ?city rdfs:label ?city_Label.
  46.     FILTER((LANGMATCHES(LANG(?astronaut_Label), "en")) && (LANGMATCHES(LANG(?astronaut_Label), "en")))
  47.     FILTER((LANGMATCHES(LANG(?country_Label), "en")) && (LANGMATCHES(LANG(?country_Label), "en")) && ((STR(?country_Label)) = "United States"))
  48.     FILTER((LANGMATCHES(LANG(?city_Label), "en")) && (LANGMATCHES(LANG(?city_Label), "en")) && (REGEX(?city_Label, "Oklahoma", "i")))
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement