Advertisement
Guest User

Untitled

a guest
May 17th, 2018
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SPARQL 1.17 KB | None | 0 0
  1. PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
  2. PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
  3. PREFIX owl: <http://www.w3.org/2002/07/owl#>
  4. PREFIX ontology: <http://dbpedia.org/ontology/>
  5.  
  6. Query B1: Find the class representing an Actor IN the dataset (USING filters).
  7.  
  8. SELECT DISTINCT ?a
  9. WHERE {
  10. ?a ?b ?c.
  11. FILTER REGEX(STR(?a), ".*actor.*", "i")
  12. }
  13.  
  14. Query B2: Find the super class for the class Actor.
  15.  
  16. SELECT DISTINCT ?c
  17. WHERE {
  18. ontology:Actor rdfs:subClassOf ?c
  19. }
  20.  
  21. Query B3: Find ALL the actors IN the dataset.
  22.  
  23.  
  24.  
  25. Query B4: Get different classes that are defined AS range of the properties that have the class Actor defined AS their domain.
  26.  
  27. SELECT DISTINCT ?c
  28. WHERE {
  29. ?a rdfs:domain ontology:Actor .
  30. ?a rdfs:range ?c
  31. }
  32.  
  33. Query B5: Find the super property of the goldenRaspberryAward property.
  34.  
  35. SELECT DISTINCT ?c
  36. WHERE {
  37. ontology:goldenRaspberryAward rdfs:subPropertyOf ?c
  38. }  
  39.  
  40. Query B6: Return ALL the properties that have the class Actor AS either their range or domain.
  41.  
  42. SELECT DISTINCT ?a
  43. WHERE {
  44. {?a rdfs:range ontology:Actor}
  45. UNION
  46. {?a rdfs:domain ontology:Actor}
  47. }  
  48.  
  49.  
  50. Query B7: Return ALL persons that are NOT actors.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement