Advertisement
Guest User

Untitled

a guest
Dec 18th, 2019
255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SPARQL 1.90 KB | None | 0 0
  1. PREFIX imo: <http://example.com/resource/>
  2.  
  3. SELECT ?id ?x ?l ?val WHERE { {
  4.     #get_all_data
  5.     #all the queries must have these 3 follow lines
  6.     ?s ?temp imo:ad.
  7.     ?s ?x ?l.
  8.     ?s imo:id ?id.
  9.    
  10.     #get_effective_area bigger than
  11.     #?val = user input
  12.     ?s imo:effective_area ?val.
  13.         FILTER(?val > 1000).
  14.        
  15.     #get_effective_area lower than
  16.     #?val = user input
  17.     ?s imo:effective_area ?val.
  18.         FILTER(?val < 1000).
  19.        
  20.     #get_total_area bigger than
  21.     # ?val = user input
  22.     ?s imo:total_area ?val.
  23.         FILTER(?val > 1000).
  24.     #get_total_area lower than
  25.     #?val = user input
  26.     ?s imo:total_area ?val.
  27.         FILTER(?val < 1000).
  28.        
  29.     #get_house_by_district
  30.     #case sensitivity Lisboa, Aveiro....
  31.     # ?district = user input
  32.     ?s imo:house_district ?district.
  33.         FILTER(?district ="Lisboa").
  34.        
  35.     #get_energy_cerficiate
  36.     #case sensitivity
  37.     #input string certificate = "([a-gA-G](\+|-)?)|(Isento)"
  38.     ?s imo:energy_certificate ?certificate.
  39.         FILTER(?certificate ="B").
  40.    
  41.     #get_house_condition
  42.     #case sensitivity
  43.     # inputs: "Renovado" || "Novo" || "Usado" || "Em construção" || "Para recuperar"
  44.     ?s imo:house_condition ?condition.
  45.         FILTER(?condition ="usado").
  46.    
  47.     #get_listing_type
  48.     #case sentivity
  49.     #inputs: "buy" | "rent"
  50.     ?s imo:listing_type ?type.
  51.         FILTER(?type ="buyRent").
  52.    
  53.     #get_number_of_rooms
  54.     #?nrooms = user input
  55.     ?s imo:number_of_rooms ?nrooms.
  56.         FILTER(?nrooms = 1).
  57.    
  58.     #get_number_of_bathrooms
  59.     #num = 1 | 2 | 3 | 4
  60.     #nbathrooms = user input
  61.     ?s imo:number_of_bathrooms ?nbathrooms.
  62.         FILTER(?nbathrooms = 1).
  63.    
  64.     #get_house_cost_by_range
  65.     #lower cost and higher cost = user input
  66.     ?s imo:house_cost ?cost.
  67.         FILTER(?cost > 200 && ?cost <300000).  
  68.        
  69.    
  70. }
  71. }LIMIT 158
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement