## describe ?ticket ?event where {?ticket a tio:Ticket; opl:providedBy ; gr:hasPriceSpecification ?price . ?event gr:includes ?ticket; ?location. ?location geo:long ?long; geo:lat ?lat; vcard:Locality ?locality; vcard:Street ?Street. } limit 100 ## ## Search by Price DESCRIBE ?s WHERE {?s a gr:UnitPriceSpecification; gr:hasCurrencyValue ?val. FILTER (?val >= 50000000) } LIMIT 500 ## ## Extended with Links to Offers in price range DEFINE input:inference "virtpivot-rules" DESCRIBE ?s ?offer WHERE {?s a gr:UnitPriceSpecification; gr:hasCurrencyValue ?val. ?offer gr:hasPriceSpecification ?s; gr:includes ?prd. FILTER (?val >= 1000000) } LIMIT 500 ## ##Inference Rules Example DEFINE input:inference "http://lod.openlinksw.com/inference/rules/goodrelations#" # show properties and property values for EAN "8714574993836" SELECT ?p ?v ?uom WHERE { ?uri a gr:ProductOrServiceModel. ?uri gr:hasEAN_UCC-13 "8714574993836"^^xsd:string. ?uri ?p ?qv. ?qv gr:hasMinValue ?v. ?qv gr:hasUnitOfMeasurement ?uom. } ##Inference Rules Example ## final query for locations providing offer, product, etc. DEFINE input:inference "http://uriburner.com/inference/rules/goodrelations#" PREFIX fc: PREFIX gr: PREFIX vcard: PREFIX foaf: PREFIX eurobau: SELECT DISTINCT ?offer ?lososp ?lososp_label ?lososp_url ?long ?lat ?posm ?posm_label ?offerlink WHERE { ?offer a gr:Offering . ?offer gr:includesObject [gr:typeOfGood ?ph] . ?ph gr:hasMakeAndModel ?posm . ?offer gr:availableAtOrFrom ?lososp . ?lososp rdfs:label ?lososp_label . ?lososp vcard:geo [vcard:longitude ?long; vcard:latitude ?lat] . ?lososp vcard:adr [vcard:url ?lososp_url] . ?offer foaf:page ?offerlink . ?offer gr:eligibleCustomerTypes gr:Enduser . ?posm a ?fc_gen . ?posm a gr:ProductOrServiceModel . ?posm rdfs:label ?posm_label . ?fc_tax fc:hierarchyCode "14101010" . ?fc_gen rdfs:subClassOf ?fc_tax . ?posm fc:P_2 [gr:hasMinValue ?minValueP_2] . FILTER(?minValueP_2>=200) . } ORDER BY ?lososp ?posm_label #Inference Rules Example # all qualitative properties from all instances of a given freeClass class: DEFINE input:inference "http://uriburner.com/inference/rules/goodrelations#" PREFIX fc: PREFIX gr: PREFIX rdfs: SELECT ?fc_property ?fc_property_label ?prop ?prop_label WHERE { ?posm a ?fc_gen . ?posm a gr:ProductOrServiceModel . ?posm ?fc_property ?prop . ?prop rdfs:label ?prop_label . FILTER(lang(?prop_label)="en") . ?fc_tax fc:hierarchyCode "14101010" . ?fc_gen rdfs:subClassOf ?fc_tax . ?fc_property a owl:ObjectProperty . ?fc_property rdfs:label ?fc_property_label . ?fc_property rdfs:subPropertyOf gr:qualitativeProductOrServiceProperty . FILTER(lang(?fc_property_label)="en") . } GROUP BY ?fc_property ORDER BY ?fc_property DESC(?prop_label) ##Inference Rules Example ## all quantitative properties from all instances of a given freeClass class: DEFINE input:inference "http://uriburner.com/inference/rules/goodrelations#" PREFIX fc: PREFIX gr: PREFIX rdfs: SELECT DISTINCT ?fc_property ?fc_property_label MIN(?minValue) as ?minvalue MAX(?maxValue) as ?maxvalue WHERE { ?posm a ?fc_gen . ?posm a gr:ProductOrServiceModel . ?posm ?fc_property ?prop . ?prop gr:hasMinValue ?minValue . ?prop gr:hasMaxValue ?maxValue . {SELECT ?fc_gen FROM WHERE {?fc_tax fc:hierarchyCode "14101010" . ?fc_gen rdfs:subClassOf ?fc_tax .} } {SELECT ?fc_property ?fc_property_label FROM WHERE {?fc_property a owl:ObjectProperty . ?fc_property rdfs:label ?fc_property_label . ?fc_property rdfs:subPropertyOf gr:quantitativeProductOrServiceProperty . FILTER(lang(?fc_property_label)="en") .} } } ## Find Cameras associated with LOC data space that have Mega Pixels data published, and are ## available in UK market. PREFIX loc: PREFIX locf: PREFIX gr: SELECT * WHERE { ?s1 ?s1textp ?o1 . ?o1 bif:contains '"Camera"' option (score ?sc). ?s1 a gr:ProductOrServiceModel. ?s1 a loc:Product. ?s1 loc:hasCountryMarket ?s2 . FILTER (?s2 = """UK""") . ?s1 locf:hasMegaPixels ?s3 . FILTER (?s3 = ). } LIMIT 20 ## Find All Vendors With All Offers And Their Prices ## greater than given value PREFIX gr: PREFIX rdfs: SELECT ?lname as ?Legal_Name ?xx as ?BizEntity ?ab as ?Offerring ?c as ?TypeOfGoods (bif:round(?cv)) as ?CurrencyValue ?bp as ?BizFunction WHERE { ?xx a gr:BusinessEntity . optional {?xx gr:legalName ?lname} . ?xx gr:offers ?ab . ?ab rdf:type gr:Offering . ?ab gr:hasBusinessFunction ?bp . ?ab gr:eligibleCustomerTypes ?el . ?ab gr:includesObject ?b . ?b rdf:type gr:TypeAndQuantityNode . ?b gr:typeOfGood ?c . ?c rdf:type gr:ProductOrServicesSomeInstancesPlaceholder . ?ab gr:hasPriceSpecification ?p . ?p gr:hasCurrencyValue ?cv . #FILTER (?cv > 6). } GROUP BY ?c HAVING ?cv > 100 ORDER BY DESC 5 LIMIT 100 ## Product Count By Manufacturer ## Where COUNT > 500 items PREFIX rdfs: PREFIX gr: PREFIX rdf: SELECT ?mnf COUNT(?prd) AS ?total WHERE { ?prd gr:hasManufacturer ?mnf . } GROUP BY ?mnf HAVING count(?prd) > 500 ORDER BY DESC 2 -- Sponger -- eBay define get:soft "replace" SELECT ?o ?v FROM WHERE {?s gr:hasPriceSpecification ?o. ?o ?p ?v.} -- Describe Camera and order results in ASC weight/zoom_factor ratio PREFIX gr: PREFIX ceo: PREFIX rdfs: SELECT ?m ?label ?weight ?ean ?zoomfactor (( ?weight / ?zoomfactor )) as ?weight_zoom_factor_ratio WHERE {?m a ceo:Camcorder. ?m rdfs:label ?label. ?m ceo:hasWeight ?v. ?m ceo:hasDigitalZoomFactor ?z. ?z gr:hasValueInteger ?zoomfactor . filter ( ?zoomfactor > 0 ) . ?v gr:hasValueFloat ?weight. ?v gr:hasUnitOfMeasurement "GRM"^^xsd:string. OPTIONAL {?m gr:hasEAN_UCC-13 ?ean} } ORDER BY ASC ( ?weight / ?zoomfactor ) --- DESC Order PREFIX gr: PREFIX ceo: PREFIX rdfs: SELECT ?m ?label ?weight ?ean ?zoomfactor (( ?weight / ?zoomfactor )) as ?weight_zoom_factor_ratio WHERE {?m a ceo:Camcorder. ?m rdfs:label ?label. ?m ceo:hasWeight ?v. ?m ceo:hasDigitalZoomFactor ?z. ?z gr:hasValueInteger ?zoomfactor . filter ( ?zoomfactor > 0 ) . ?v gr:hasValueFloat ?weight. ?v gr:hasUnitOfMeasurement "GRM"^^xsd:string. OPTIONAL {?m gr:hasEAN_UCC-13 ?ean} } ORDER BY DESC ( ?weight / ?zoomfactor ) -- Others # Offerings in LOC space by currency # the first 50 items in the space that cost between 5 and 10 EUR or 7 and 14 USD. PREFIX xsd: PREFIX gr: SELECT ?s ?p ?c WHERE { ?s a gr:Offering. ?s gr:hasPriceSpecification ?ps. ?ps gr:hasCurrencyValue ?p. ?ps gr:hasCurrency ?c. FILTER ((regex(?c, "EUR") && ?p >"5"^^xsd:float && ?p <"10"^^xsd:float) || (regex(?c, "USD") && ?p >"7"^^xsd:float && ?p <"14"^^xsd:float)) } LIMIT 50 # List of Class Frequency SELECT ?class, count(?instance) as ?freq WHERE { ?instance a ?class. {SELECT ?class FROM WHERE {?class a owl:Class. } } } -- Describe Camera and order results in ASC weight/zoom_factor ratio PREFIX gr: PREFIX ceo: PREFIX rdfs: SELECT ?m ?label ?weight ?ean ?zoomfactor (( ?weight / ?zoomfactor )) as ?weight_zoom_factor_ratio WHERE {?m a ceo:Camcorder. ?m rdfs:label ?label. ?m ceo:hasWeight ?v. ?m ceo:hasDigitalZoomFactor ?z. ?z gr:hasValueInteger ?zoomfactor . filter ( ?zoomfactor > 0 ) . ?v gr:hasValueFloat ?weight. ?v gr:hasUnitOfMeasurement "GRM"^^xsd:string. OPTIONAL {?m gr:hasEAN_UCC-13 ?ean} } ORDER BY ASC ( ?weight / ?zoomfactor ) --- DESC Order PREFIX gr: PREFIX ceo: PREFIX rdfs: SELECT ?m ?label ?weight ?ean ?zoomfactor (( ?weight / ?zoomfactor )) as ?weight_zoom_factor_ratio WHERE {?m a ceo:Camcorder. ?m rdfs:label ?label. ?m ceo:hasWeight ?v. ?m ceo:hasDigitalZoomFactor ?z. ?z gr:hasValueInteger ?zoomfactor . filter ( ?zoomfactor > 0 ) . ?v gr:hasValueFloat ?weight. ?v gr:hasUnitOfMeasurement "GRM"^^xsd:string. OPTIONAL {?m gr:hasEAN_UCC-13 ?ean} } ORDER BY DESC ( ?weight / ?zoomfactor ) -- Stats # PART 1: List of Class Frequency SELECT ?class, count(?instance) as ?freq WHERE { ?instance a ?class. {SELECT ?class FROM WHERE {?class a owl:Class. } } } # PART 1: List of Class Frequency SELECT ?class, ?freq WHERE {{SELECT ?class, count(?instance) as ?freq WHERE { ?instance a ?class. {SELECT ?class FROM WHERE {?class a owl:Class. } } } }} ORDER BY DESC (?freq) # PART 2: List of Object Property Frequency SELECT ?prop, ?label, count(?instance) as ?freq WHERE { ?instance ?prop ?object. {SELECT ?prop, ?label FROM WHERE {?prop a owl:ObjectProperty. ?prop rdfs:label ?label. } } } # PART 3: List of Datatype Property Frequency SELECT ?prop, ?label, count(?instance) as ?freq WHERE { ?instance ?prop ?object. {SELECT ?prop, ?label FROM WHERE {?prop a owl:DatatypeProperty. ?prop rdfs:label ?label. } } }