All eligibleRegions values must be valid codes of ISO 3166-1 or ISO 3166-2
"AT", "DE", "US", etc. are valid ISO 3166-1 codes. "AT-7" (Tyrol), "DE-BY" (Bavaria), etc. are valid ISO 3166-2 codes.
@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#> .
<http://www.heppnetz.de/ontologies/examples/gr#Offering_1> a gr:Offering;
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;
gr:eligibleRegions "AT-77"^^xsd:string.
PREFIX gr:<http://purl.org/goodrelations/v1#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX geonames: <http://www.geonames.org/ontology#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
SELECT ?object WHERE {
?object gr:eligibleRegions ?value .
FILTER (
!bif:exists ((
SELECT ?code FROM <http://ontologi.es/place/>
WHERE {
{?s a geonames:Country.} UNION {?s a geonames:Feature.}
?s skos:notation ?code.
FILTER(str(?value) = str(?code))
}
))
)
}