Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,10 @@
/coverage.xml
/.coverage
/.idea/*
.vscode/settings.json
entityshape/__pycache__/
entityshape/api_v1/__pycache__/
entityshape/api_v2/__pycache__/
tests/__pycache__/
tests/tests_api_v1/__pycache__/
tests/tests_api_v2/__pycache__/
14 changes: 14 additions & 0 deletions tests/fixtures/E236.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"id": "E236",
"serializationVersion": "3.0",
"labels": {
"en": "Member of the Oireachtas",
"fr": "membre du Parlement Irlandais"
},
"descriptions": {
"en": "member of the Irish parliament"
},
"aliases": [],
"schemaText": "PREFIX wdt: \u003Chttp://www.wikidata.org/prop/direct/\u003E\nPREFIX wd: \u003Chttp://www.wikidata.org/entity/\u003E\nstart = @\u003CTD\u003E\n\n\u003CTD\u003E EXTRA wdt:P39 wdt:P106 wdt:P27 { # TD can have other position helds or occupations than those mentioned below\n wdt:P31 [wd:Q5]; # 1 instance of with value human\n wdt:P4690 .; # 1 oireachtas member id with any value\n wdt:P39 [wd:Q654291 wd:Q18043391] +; # 1 or more position held with teachta dala or senator of ireland\n wdt:P106 [wd:Q82955] ; # 1 occupation with value politician\n wdt:P734 . +; # 1 or more given name with any value\n wdt:P735 .+; # 1 or more surname with any value\n wdt:P569 .; # 1 date of birth with any value\n wdt:P102 .*; # 0 or more member of political party with any value\n wdt:P21 [wd:Q6581097 wd:Q6581072 wd:Q1097630 wd:Q1052281 wd:Q2449503 wd:Q48270]; # 1 gender with these values\n wdt:P27 [wd:Q27 wd:Q31747 wd:Q1140152] +;\n wdt:P18 . +; # 1 or more images with any value\n}",
"type": "ShExC"
}
13 changes: 13 additions & 0 deletions tests/fixtures/E295.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"id": "E295",
"serializationVersion": "3.0",
"labels": {
"en": "townland"
},
"descriptions": {
"en": "schema to describe a townland (small geographic division of Ireland)"
},
"aliases": [],
"schemaText": "PREFIX wd: \u003Chttp://www.wikidata.org/entity/\u003E\nPREFIX wdt: \u003Chttp://www.wikidata.org/prop/direct/\u003E\nstart = @\u003Ctownland\u003E\n\n\u003Ctownland\u003E {\n wdt:P31 [wd:Q2151232];\n wdt:P17 [wd:Q27 wd:Q145];\n wdt:P625 .;\n wdt:P131 .*;\n wdt:P7959 @\u003Ccounty\u003E;\n wdt:P5097 .;\n wdt:P402 . ;\n wdt:P361 . {0};\n}\n\n\u003Ccounty\u003E EXTRA wdt:P31 {\n wdt:P31 [wd:Q179872 wd:Q1317848];\n}",
"type": "ShExC"
}
13 changes: 13 additions & 0 deletions tests/fixtures/E297.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"id": "E297",
"serializationVersion": "3.0",
"labels": {
"en": "sailboat class"
},
"descriptions": {
"en": "schema to describe a sailboat class"
},
"aliases": [],
"schemaText": "PREFIX pq: \u003Chttp://www.wikidata.org/prop/qualifier/\u003E\nPREFIX ps: \u003Chttp://www.wikidata.org/prop/statement/\u003E\nPREFIX p: \u003Chttp://www.wikidata.org/prop/\u003E\nPREFIX wd: \u003Chttp://www.wikidata.org/entity/\u003E\nPREFIX wdt: \u003Chttp://www.wikidata.org/prop/direct/\u003E\n\nstart = @\u003Csailboatclass\u003E\n\n\u003Csailboatclass\u003E {\n # Defining properties\n wdt:P31 [wd:Q106179098];\n wdt:P279 @\u003Csubclass\u003E +;\n # Required properties\n wdt:P18 .+;\n wdt:P176 .;\n wdt:P287 .;\n p:P2048 @\u003Cheight\u003E;\n p:P2049 @\u003Cwidth\u003E;\n p:P2043 @\u003Clength1\u003E;\n p:P2043 @\u003Clength2\u003E;\n p:P2067 @\u003Cmass1\u003E;\n p:P2067 @\u003Cmass2\u003E;\n # Optional properties\n wdt:P5962 .*;\n wdt:P2079 .*;\n wdt:P516 .*;\n wdt:P5869 .*;\n}\n \n\u003Csubclass\u003E EXTRA wdt:P31 {\n wdt:P31 [wd:Q16103215];\n}\n\n\u003Clength1\u003E {\n pq:P642 [wd:Q2358152];\n}\n\n\u003Clength2\u003E {\n pq:P642 [wd:Q1817392];\n}\n\n\u003Cwidth\u003E {\n pq:P642 [wd:Q2376482];\n}\n\n\u003Cheight\u003E {\n pq:P642 [wd:Q244777 wd:Q2446632]\n}\n\n\u003Cmass1\u003E {\n pq:P642 [wd:Q5636358]\n}\n\n\u003Cmass2\u003E {\n pq:P642 [wd:Q5461048]\n}",
"type": "ShExC"
}
11 changes: 11 additions & 0 deletions tests/fixtures/E300.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"id": "E300",
"serializationVersion": "3.0",
"labels": {
"en": "motor racing season"
},
"descriptions": [],
"aliases": [],
"schemaText": "PREFIX rdf: \u003Chttp://www.w3.org/1999/02/22-rdf-syntax-ns#\u003E\nPREFIX rdfs: \u003Chttp://www.w3.org/2000/01/rdf-schema#\u003E\nPREFIX pq: \u003Chttp://www.wikidata.org/prop/qualifier/\u003E\nPREFIX ps: \u003Chttp://www.wikidata.org/prop/statement/\u003E\nPREFIX p: \u003Chttp://www.wikidata.org/prop/\u003E\nPREFIX wd: \u003Chttp://www.wikidata.org/entity/\u003E\nPREFIX wdt: \u003Chttp://www.wikidata.org/prop/direct/\u003E\n\nstart = @\u003Cauto-racing-season\u003E\n\n\u003Cauto-racing-season\u003E {\n wdt:P31 [ wd:Q27020041 ]; # 1 instance of with value sports season\n p:P3450 @\u003Cseason\u003E; # 1 property sports season of league or competition with shape season\n wdt:P641 @\u003Csport\u003E; # 1 sport with any value\n wdt:P585 .; # 1 point in time with any value\n wdt:P1346 .*; # 0 or more winner with any value\n wdt:P1132 .?; # 0 or 1 value no of participants with any value\n wdt:P1350 .?; # 0 or 1 value number of matches played/races/starts with any value\n # Labels\n rdfs:label [@en] + ; # 1 or more labels with a langstring\n}\n\n\u003Cseason\u003E {\n ps:P3450 @\u003Cseason_type\u003E; # 1 statement sports season of league or competition with any value\n pq:P155 .?; # 1 qualifier follows with any value\n pq:P156 .?; # 1 qualifier followed by with any value\n}\n\n\u003Cseason_type\u003E EXTRA wdt:P31 {\n wdt:P31 [ wd:Q60147807 ]; # 1 instance of with value value automobile racing series\n} \n\n\u003Csport\u003E {\n wdt:P279 [ wd:Q5386 ] ; # 1 subclass of with value auto racing\n}",
"type": "ShExC"
}
13 changes: 13 additions & 0 deletions tests/fixtures/E351.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"id": "E351",
"serializationVersion": "3.0",
"labels": {
"en": "pharmaceutical product"
},
"descriptions": {
"en": "A therapeutical product, usually containing one or more types of compounds as active ingredients."
},
"aliases": [],
"schemaText": "PREFIX wd: \u003Chttp://www.wikidata.org/entity/\u003E\nPREFIX wdt: \u003Chttp://www.wikidata.org/prop/direct/\u003E\n\n#Query for validation: SELECT ?id WHERE {?id wdt:P31 wd:Q28885102 . } LIMIT 10 \n\nstart = @\u003Cpharmaceutical_product\u003E\n\n\u003Cpharmaceutical_product\u003E EXTRA wdt:P31 {\n\twdt:P31 [ wd:Q28885102] ;\n\twdt:P3781 @\u003Cpharmaceutical_product-P3781\u003E + ;\n\twdt:P4044 @\u003Cpharmaceutical_product-P4044\u003E * ;\n\twdt:P3345 . ? ;\n\twdt:P7048 . ? ;\n\twdt:P18 . * ;\n\twdt:P3637 . ? ;\n}\n\n\u003Cpharmaceutical_product-P3781\u003E EXTRA wdt:P31 {\n\twdt:P31 [ wd:Q59199015 wd:Q113145171 wd:Q467717 wd:Q79529] ;\n}\n\n\u003Cpharmaceutical_product-P4044\u003E EXTRA wdt:P31 {\n\twdt:P31 [ wd:Q112193867] ;\n}",
"type": "ShExC"
}
14 changes: 14 additions & 0 deletions tests/fixtures/E438.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"id": "E438",
"serializationVersion": "3.0",
"labels": {
"en": "Wikimedia Disambiguation Page",
"ja": "ウィキメディアの曖昧さ回避ページ"
},
"descriptions": {
"en": "Entity schema of Wikimedia Disambiguation Page"
},
"aliases": [],
"schemaText": "PREFIX wdt: \u003Chttp://www.wikidata.org/prop/direct/\u003E\nPREFIX wd: \u003Chttp://www.wikidata.org/entity/\u003E\n\nstart = @\u003Cwikimedia-disambiguation-page\u003E\n\n\u003Cwikimedia-disambiguation-page\u003E {\n\twdt:P31 [ wd:Q4167410] ;\n}",
"type": "ShExC"
}
32 changes: 32 additions & 0 deletions tests/fixtures/E56.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"id": "E56",
"serializationVersion": "3.0",
"labels": {
"da": "dansk udsagnsord",
"en": "Danish verb",
"eo": "dana verbo",
"fr": "verbe danois",
"ja": "デンマーク語の動詞",
"nl": "Deens werkwoord",
"pl": "czasownik duński",
"pt": "verbo (danês)",
"szl": "czasownik duński",
"vec": "verbo danezo"
},
"descriptions": {
"en": "basic schema for Danish verbs",
"fr": "lexème danois",
"ja": "デンマーク語の動詞を記述するための基本的なスキーマ",
"nl": "basisschema voor een Deens werkwoord",
"pl": "podstawowy schemat czasowników duńskich",
"szl": "bazowy schymat czasowników duńskich"
},
"aliases": {
"da": [
"dansk verbum",
"danske verber"
]
},
"schemaText": "IMPORT \u003Chttps://www.wikidata.org/wiki/Special:EntitySchemaText/E15\u003E\nPREFIX E15: \u003Chttps://www.wikidata.org/wiki/Special:EntitySchemaText/E15#\u003E\n\nPREFIX dct: \u003Chttp://purl.org/dc/terms/\u003E\nPREFIX ontolex: \u003Chttp://www.w3.org/ns/lemon/ontolex#\u003E\nPREFIX p: \u003Chttp://www.wikidata.org/prop/\u003E\nPREFIX ps: \u003Chttp://www.wikidata.org/prop/statement/\u003E\nPREFIX rdf: \u003Chttp://www.w3.org/1999/02/22-rdf-syntax-ns#\u003E\nPREFIX wd: \u003Chttp://www.wikidata.org/entity/\u003E\nPREFIX wdno: \u003Chttp://www.wikidata.org/prop/novalue/\u003E\nPREFIX wdt: \u003Chttp://www.wikidata.org/prop/direct/\u003E\nPREFIX wikibase: \u003Chttp://wikiba.se/ontology#\u003E\nPREFIX xsd: \u003Chttp://www.w3.org/2001/XMLSchema#\u003E\n\n# SELECT ?lexeme { ?lexeme dct:language wd:Q9035 ; wikibase:lexicalCategory wd:Q24905 }\n\nstart = @\u003Cdanish-verb\u003E\n\n\u003Cdanish-verb\u003E {\n\n dct:language [ wd:Q9035 ]\n // rdf:label \"Danish language\"\n // rdf:comment \"must be Danish language\" ;\n\n wikibase:lexicalCategory [ wd:Q24905 ]\n // rdf:label \"verb\"\n // rdf:comment \"lexeme must have verb as the lexical category\" ; \n\n\n wdt:P31 IRI +\n # [\n # wd:Q245423 # compound\n # wd:Q493000 # unadapted loanword\n # wd:Q560570 # modal verb\n # wd:Q55773200 # monovalent verb\n # wd:Q112653827 # prefixed-derived word\n # wd:Q1340504 # lexical verb\n # ] *\n // rdf:label \"instance of\"\n // rdf:comment \"zero or more instance of\" ;\n\n wdt:P1343 IRI *\n // rdf:label \"described in\"\n // rdf:comment \"zero or more described in\" ;\n\n wdt:P5323 IRI *\n // rdf:label \"attested in\"\n // rdf:comment \"zero or more attested in\" ;\n\n wdt:P5186 IRI {0,3}\n // rdf:label \"conjugation class\"\n // rdf:comment \"zero or up to three conjugation classes\" ;\n\n wdt:P9295 [ wd:Q116946936 wd:Q116946937 ] {1,2}\n // rdf:label \"transitivity\"\n // rdf:comment \"either transitive or intransitive or both\" ;\n\n wdt:P5187 [ @da ] + \n // rdf:label \"word stem\"\n // rdf:comment \"the word stem must be Danish\" ;\n\n wdt:P5831 [ @da ] + \n // rdf:label \"usage example\"\n // rdf:comment \"one or more usage examples\" ;\n\n wdt:P5401 [ wd:L3828 wd:L5025 ] {1,2}\n // rdf:label \"auxilliary verb\"\n // rdf:comment \"Danish verb must have one or two auxilliary verbs\" ;\n\n wdt:P5238 IRI {0,4}\n // rdf:label \"compound parts\"\n // rdf:comment \"zero or up to four compound parts\" ;\n\n wdt:P5402 IRI *\n // rdf:label \"homograph lexeme\"\n // rdf:comment \"zero or more homograph lexemes\" ;\n\n p:P6140 @E15:dannet-statement \n // rdf:label \"DanNet\"\n // rdf:comment \"DanNet, either a value or novalue\" ; \n\n p:P5912 @E15:oqaasileriffik-statement + \n // rdf:label \"Oqaasileriffik ID\"\n // rdf:comment \"Must have novalue or one or more\" ;\n \n wdt:P12828 xsd:string ?\n // rdf:label \"ID for DAKA\"\n // rdf:comment \"Either one or none ID for DAKA\" ;\n\n wdt:P9529 xsd:string ?\n // rdf:label \"ID for Den Danske Ordbog\"\n // rdf:comment \"Either one or none ID for Den Danske Ordbog\" ;\n\n\n ontolex:lexicalForm @\u003Cdanish-form\u003E + ;\n\n}\nAND {\n # Some verbs might have two conjugation classes as they alternate between them\n wdt:P5186 [\n wd:Q54397142 # First Danish conjugation class\n wd:Q54553380 # Second Danish conjugation class\n wd:Q62494135 # Third Danish conjugation class\n wd:Q62497713 # Fourth a-o-a series\n wd:Q64541795 # Fourth e-a-e series\n wd:Q64541813 # Fourth e-o-e series\n wd:Q64541838 # Fourth e-å-e series\n wd:Q64578156 # Fourth i-a-i series\n wd:Q64347075 # Fourth i-a-u series\n wd:Q64578111 # Fourth i-e-e series\n wd:Q64578756 # Fourth i-e-i series\n wd:Q64580566 # Fourth i-å-i series\n wd:Q64580876 # Fourth y-a-u-series\n wd:Q64580346 # Fourth y-ø-o series\n wd:Q64578184 # Fourth y-ø-y series\n wd:Q64541975 # Fourth y-ø-ø series\n wd:Q64354480 # Fourth æ-a-u series\n wd:Q63860153 # Fourth æ-a-å series\n wd:Q64362028 # Fourth å-i-å series\n wd:Q63860277 # Fourth å-o-å series\n wd:Q64578636 # Fourty same stem vowel\n ] {1,3}\n // rdf:label \"Danish conjugation class\"\n // rdf:comment \"The conjugation class should belong to a restricted set of Danish conjugation classes and some verbs might have two conjugation classes as they alternate between them.\" ; \n }\n OR EXTRA wdt:P31 {\n\n wdt:P31 [ wd:Q465800 wd:Q560570 wd:Q262501 wd:Q49102827 ] + \n // rdf:label \"conjugation class exception\"\n // rdf:comment \"Conjugation class exceptions for auxillary, modal, deponent and reciprocal.\" ; \n\n }\n\n\n\u003Cdanish-form\u003E {\n wikibase:grammaticalFeature IRI+\n}",
"type": "ShExC"
}
Loading
Loading