Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
200 lines (164 sloc) 8.5 KB
@prefix v: <http://dev.vocab.org/> .
@prefix trigger: <http://dev.vocab.org/trigger/> .
@prefix validator: <http://dev.vocab.org/validator/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix dataid-mt: <http://dataid.dbpedia.org/ns/mt#> .
v:RDF_IRI_Trigger a rdfs:Class;
rdfs:label "RDF IRI Trigger" ;
rdfs:comment "triggers on IRIs in RDF" ;
v:applicableMediaType dataid-mt:ApplicationNTriples .
#########################
# Reusable Triggers, several triggers per TestCase
#########################
# TODO trigger does not seem to work
trigger:wikipedia
a v:RDF_IRI_Trigger ;
trigger:pattern "^http://en.wikipedia.org/wiki/" ;
rdfs:label "wikipedia" .
<#wikipedia_IRIs>
a v:TestGenerator ;
v:trigger trigger:wikipedia ;
# same as dbpedia
v:validator validator:dissallowed_chars ;
v:validator validator:dbpedia_resource_delims ;
v:validator [
a v:IRI_Validator ;
v:doesNotContain "<" , ">", "\"" , " ", "{", "}", "|", "\\", "^" , "`"
] .
trigger:generic_wikipedia_dbpedia_extraction
a v:RDF_IRI_Trigger ;
trigger:pattern "^http://(ga\\.|af\\.|als\\.|am\\.|an\\.|ar\\.|arz\\.|ast\\.|az\\.|azb\\.|ba\\.|bar\\.|batsmg\\.|be\\.|bg\\.|bn\\.|bpy\\.|br\\.|bs\\.|bug\\.|ca\\.|cdo\\.|ce\\.|ceb\\.|ckb\\.|cs\\.|cv\\.|cy\\.|da\\.|de\\.|el\\.|eml\\.|en\\.|eo\\.|es\\.|et\\.|eu\\.|fa\\.|fi\\.|fo\\.|fr\\.|fy\\.|gd\\.|gl\\.|gu\\.|he\\.|hi\\.|hr\\.|hsb\\.|ht\\.|hu\\.|hy\\.|ia\\.|id\\.|ilo\\.|io\\.|is\\.|it\\.|ja\\.|jv\\.|ka\\.|kk\\.|kn\\.|ko\\.|ku\\.|ky\\.|la\\.|lb\\.|li\\.|lmo\\.|lt\\.|lv\\.|mai\\.|mg\\.|mhr\\.|min\\.|mk\\.|ml\\.|mn\\.|mr\\.|mrj\\.|ms\\.|my\\.|mzn\\.|nan\\.|nap\\.|nds\\.|ne\\.|new\\.|nl\\.|nn\\.|no\\.|oc\\.|or\\.|os\\.|pa\\.|pl\\.|pms\\.|pnb\\.|pt\\.|qu\\.|ro\\.|ru\\.|sa\\.|sah\\.|scn\\.|sco\\.|sd\\.|sh\\.|si\\.|simple\\.|sk\\.|sl\\.|sq\\.|sr\\.|su\\.|sv\\.|sw\\.|ta\\.|te\\.|tg\\.|th\\.|tl\\.|tr\\.|tt\\.|uk\\.|ur\\.|uz\\.|vec\\.|vi\\.|vo\\.|wa\\.|war\\.|wuu\\.|xmf\\.|yi\\.|yo\\.|yue\\.|zh\\.)?dbpedia.org/resource/" ;
rdfs:label "DBpedia IRIs from Wikipedia used in Generic Extraction" ;
rdfs:comment "Starting with http://dbpedia.org or for 140 languages with http://xx.dbpedia.org" .
trigger:mappings_wikipedia_dbpedia_extraction
a v:RDF_IRI_Trigger ;
trigger:pattern "^http://(ar\\.|az\\.|be\\.|bg\\.|bn\\.|ca\\.|cs\\.|cy\\.|da\\.|de\\.|el\\.|en\\.|eo\\.|es\\.|et\\.|eu\\.|fa\\.|fi\\.|fr\\.|ga\\.|gl\\.|hi\\.|hr\\.|hu\\.|hy\\.|id\\.|it\\.|ja\\.|ko\\.|lt\\.|lv\\.|mk\\.|nl\\.|pl\\.|pt\\.|ro\\.|ru\\.|sk\\.|sl\\.|sr\\.|sv\\.|tr\\.|uk\\.|ur\\.|vi\\.|war\\.|zh\\.|commons\\.)?dbpedia.org/resource/" ;
rdfs:label "DBpedia IRIs from Wikipedia used in Generic Extraction" ;
rdfs:comment "Starting with http://dbpedia.org or for 40 mapped languages with http://xx.dbpedia.org" .
trigger:wikidata_dbpedia_extraction
a v:RDF_IRI_Trigger ;
trigger:pattern "^http://wikidata.dbpedia.org/resource/Q" ;
rdfs:label "DBpedia IRIs from Wikidata extraction" ;
rdfs:comment "Starting with http://wikidata.dbpedia.org/resource/Q" .
trigger:wikidata
a v:RDF_IRI_Trigger ;
trigger:pattern "^http://www.wikidata.org/entity/Q" ;
rdfs:label "Wikidata IRIs" ;
rdfs:comment "Starting with http://www.wikidata.org/entity/Q" .
trigger:dbpedia_ontology
a v:RDF_IRI_Trigger ;
trigger:pattern "^http://dbpedia.org/ontology/" ;
rdfs:label "DBpedia Ontology IRIs" ;
rdfs:comment "http://dbpedia.org/ontology/" .
############### TODO Vocab triggers, can be automated
trigger:wgs84
a v:RDF_IRI_Trigger ;
trigger:pattern "^http://www.w3.org/2003/01/geo/wgs84_pos#" ;
rdfs:label "whs84 trigger" ;
rdfs:comment "http://www.w3.org/2003/01/geo/wgs84_pos#" .
trigger:georss
a v:RDF_IRI_Trigger ;
trigger:pattern "^http://www.georss.org/georss/" ;
rdfs:label "georss trigger" ;
rdfs:comment "http://www.georss.org/georss/" .
trigger:w3_rdfs
a v:RDF_IRI_Trigger ;
trigger:pattern "^http://www.w3.org/2000/01/rdf-schema#" ;
rdfs:label "rdfs trigger" ;
rdfs:comment "http://www.w3.org/2000/01/rdf-schema#" .
trigger:w3_rdf
a v:RDF_IRI_Trigger ;
trigger:pattern "^http://www.w3.org/1999/02/22-rdf-syntax-ns#" ;
rdfs:label "rdf trigger" ;
rdfs:comment "http://www.w3.org/1999/02/22-rdf-syntax-ns#" .
trigger:foaf_name
a v:RDF_IRI_Trigger ;
trigger:pattern "^http://xmlns.com/foaf/0.1/" ;
rdfs:label "foaf trigger" ;
rdfs:comment "http://xmlns.com/foaf/0.1/" .
#########################
# Reusable Validators, several Validators per TestCase
#########################
# todo check https://sourceforge.net/p/dbpedia/mailman/message/28982391/
# http://en.wikipedia.org/wiki/Wikipedia:Naming_conventions_(technical_restrictions)#Forbidden_characters
validator:dissallowed_chars
a v:IRI_Validator ;
rdfs:comment """Dissallowed in URIs, cf. https://www.ietf.org/rfc/rfc3987.txt: Systems accepting IRIs MAY also deal with the printable characters in US-ASCII that are not allowed in URIs, namely "<", ">", '"', space, "{", "}", "|", "\", "^", and "`", in step 2 above. If these characters are found but are not converted, then the conversion SHOULD fail. Please note that the number sign ("#"), the percent sign ("%"), and the square bracket characters ("[", "]") are not part of the above list and MUST NOT be converted. """ ;
v:doesNotContain "<" , ">", "\"" , " ", "{", "}", "|", "\\", "^" , "`" .
validator:reserved_gen_delims
a v:IRI_Validator ;
rdfs:comment """reserved gen-delims from https://www.ietf.org/rfc/rfc3987.txt ":", "?", "#", "[", "]", "/", "@" """ ;
v:doesNotContain ":", "?", "#", "[", "]", "@" .
validator:reserved_sub_delims
a v:IRI_Validator ;
rdfs:comment """reserved sub-delims from https://www.ietf.org/rfc/rfc3987.txt "!", "$", "&", "'", "(", ")", "*", "+", ",", ";", "=" """ ;
v:doesNotContain "!", "$", "&", "'", "(", ")", "*", "+", ",", ";", "=" .
validator:dbpedia_resource_delims
a v:IRI_Validator ;
rdfs:comment """
1. gen-delims are not allowed, except ":" and "@" per rfc3987
"ipchar = iunreserved / pct-encoded / sub-delims / ":" / "@" "
2. sub-delims are allowed:
These are allowed in DBpedia Uris, so we check that they are not encoded
sub-delims = "%21", "%24", "%26", "%27", "%28", "%29", "%2A", "%2B", "%2C", "%3B", "%3D"
sub-delims = "!", "$", "&", "'", "(", ")", "*", "+", ",", ";", "="
reserved gen-delims from above """ ;
v:doesNotContain "?", "#", "[", "]" ;
v:doesNotContain "%21", "%24", "%26", "%27", "%28", "%29", "%2A", "%2B", "%2C", "%3B", "%3D" .
validator:dbpedia_ontology
a v:IRI_Validator ;
# todo get download URL of the ontology from the bus
# v:oneOfVocab <https://databus.dbpedia.org/dbpedia/ontology/dbo-snapshots/latest/.nt>
# todo use this for now
v:oneOfVocab <https://raw.githubusercontent.com/dbpedia/ontology-tracker/master/databus/dbpedia/ontology/dbo-snapshots/dbo-snapshots.nt> .
# no priority to implement this
validator:dbpedia_external_properties
a v:IRI_Validator ;
v:oneOf "http://www.w3.org/2000/01/rdf-schema#seeAlso" ;
v:oneOf "http://xmlns.com/foaf/0.1/name" ;
v:oneOf "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" ;
v:oneOf "http://www.w3.org/2003/01/geo/wgs84_pos#long" ;
v:oneOf "http://www.georss.org/georss/point" ;
v:oneOf "hhttp://www.w3.org/2003/01/geo/wgs84_pos#lat" .
#########################
# Specific instantiations below
#########################
<#genericDBpediaWikipediaIRIs>
a v:TestGenerator ;
v:trigger trigger:generic_wikipedia_dbpedia_extraction ;
v:validator validator:dissallowed_chars ;
v:validator validator:dbpedia_resource_delims .
<#mappingsDBpediaWikipediaIRIs>
a v:TestGenerator ;
v:trigger trigger:mappings_wikipedia_dbpedia_extraction ;
v:validator validator:dissallowed_chars ;
v:validator validator:dbpedia_resource_delims .
<#dbpediaOntology>
a v:TestGenerator ;
v:trigger trigger:dbpedia_ontology ;
v:validator validator:dissallowed_chars ;
v:validator validator:dbpedia_ontology .
<#dbpediaGenericProperty>
a v:TestGenerator ;
v:trigger [
a v:RDF_IRI_Trigger ;
rdfs:label "DBpedia Generic IRIs" ;
trigger:pattern "^http://dbpedia.org/property/"
] .
# TODO validator
# no priority to implement this
<#dbpediaExternalProperties>
a v:TestGenerator ;
v:trigger trigger:foaf ;
v:trigger trigger:w3_rdf ;
v:trigger trigger:w3_rdfs ;
v:trigger trigger:wgs84 ;
v:trigger trigger:georss ;
v:validator validator:dbpedia_external_properties .
<#wikidata_IRIs>
a v:TestGenerator ;
v:trigger trigger:wikidata ;
v:validator [
a v:IRI_Validator ;
v:pattern "^http://www.wikidata.org/entity/Q[0-9]+$"
] .
You can’t perform that action at this time.