There are some elements not defined in V1 of GoodRelations.
Care must be taken that all concepts and properties of GR are used properly and elements from other ontologies are properly related to GR.
@prefix gr: <http://purl.org/goodrelations/v1#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix toy: <http://www.heppnetz.de/ontologies/examples/toy#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix foo: <http://www.heppnetz.de/ontologies/examples/gr#Offering_wrong_spelled> .
foo:MisspeltClass a gr:Offeringg; # should be gr:Offering with one "g"
gr:hasBusinessFunction gr:Sell;
gr:validFrom "2010-11-12T00:00:00+01:00"^^xsd:dateTime;
gr:validThrough "2010-11-12T23:59:59+01:00"^^xsd:dateTime .
foo:MisspeltInstance a gr:Offering;
gr:hasBusinessFunction gr:Sale; # should be gr:Sell
gr:validFrom "2010-11-12T00:00:00+01:00"^^xsd:dateTime;
gr:validThrough "2010-11-12T23:59:59+01:00"^^xsd:dateTime .
foo:MisspeltProperty a gr:Offering; # should be gr:Offering with one "g"
gr:hasBusinessFunctions gr:Sell; # should be gr:hasBusinessFunction
gr:validFrom "2010-11-12T00:00:00+01:00"^^xsd:dateTime;
gr:validThrough "2010-11-12T23:59:59+01:00"^^xsd:dateTime .
SELECT ?object
WHERE {
{?object ?p ?gr.
FILTER (#regex(?gr, "^http://purl.org/goodrelations/v1#")
(bif:left(str(?gr),33) = "http://purl.org/goodrelations/v1#")
&&
!bif:exists ((
SELECT ?gr
FROM <http://purl.org/goodrelations/v1#>
WHERE {
?gr rdfs:isDefinedBy ?o.
FILTER (?o = <http://purl.org/goodrelations/v1>)
}
))
)
}
UNION
{?object ?grprop ?b.
FILTER (#regex(?grprop, "^http://purl.org/goodrelations/v1#")
(bif:left(str(?grprop),33) = "http://purl.org/goodrelations/v1#")
&&
!bif:exists ((
SELECT ?grprop
FROM <http://purl.org/goodrelations/v1#>
WHERE {
?grprop rdfs:isDefinedBy ?o.
FILTER (?o = <http://purl.org/goodrelations/v1>)
}
))
)
}
}