diff --git a/reasoning-and-inference/built-in-reasoning-and-inference-kb-comedian.sql b/reasoning-and-inference/built-in-reasoning-and-inference-kb-comedian.sql new file mode 100755 index 0000000..b134cf6 --- /dev/null +++ b/reasoning-and-inference/built-in-reasoning-and-inference-kb-comedian.sql @@ -0,0 +1,179 @@ +SPARQL CLEAR GRAPH ; +SPARQL CLEAR GRAPH ; +SPARQL CLEAR GRAPH ; + +--KBpedia Tbox (Terminology Box) + +SPARQL +PREFIX wd: +PREFIX wdt: +PREFIX kbpedia: + +INSERT INTO GRAPH +{ + ?class a ?o +} + +WHERE + { + SERVICE + { + SELECT * + FROM + WHERE + { + ?class a ?o. + FILTER (?class = kbpedia:Comedian). + } + } + + }; + +-- Wikidata Tbox (Terminology Box) + +SPARQL +PREFIX wd: +PREFIX wdt: +PREFIX kbpedia: + +INSERT INTO GRAPH +{ + ?class a ?o +} + +WHERE + { + SERVICE + { + SELECT * + #FROM + WHERE + { + ?class a ?o. + FILTER (?class = wd:Q245068). + } + } + + }; + +-- Wikidata Abox (Assertions Box) + +SPARQL +PREFIX wd: +PREFIX wdt: +PREFIX kbpedia: + +INSERT INTO GRAPH +{ + ?entity ?p ?class +} + +WHERE + { + SERVICE + { + SELECT * + WHERE + { + ?entity ?p ?class. + FILTER (?p = wdt:P106 && ?class = wd:Q245068). + } + LIMIT 100 + } + + }; + +SPARQL +CLEAR GRAPH ; +DELETE +FROM DB.DBA.SYS_RDF_SCHEMA +WHERE RS_NAME = 'urn:kbpedia:comedian:owl:equivalent:class:subproperty:inference:rules' ; + +SPARQL +PREFIX wd: +PREFIX wdt: +PREFIX kbpedia: + +DELETE { + GRAPH + { + #kbpedia:Comedian owl:equivalentClass wd:Q245068 . + wd:Q245068 owl:equivalentClass kbpedia:Comedian . + + } + } ; + +SPARQL +PREFIX wd: +PREFIX wdt: +PREFIX owl: +PREFIX rdfs: +PREFIX kbpedia: + +INSERT { + GRAPH + { + kbpedia:Comedian owl:equivalentClass wd:Q245068 . + #wd:Q245068 owl:equivalentClass kbpedia:Comedian . + wdt:P106 rdfs:subPropertyOf rdf:type . + owl:equivalentProperty a owl:TransitiveProperty . + owl:equivalentClass a owl:TransitiveProperty. + rdfs:subPropertyOf a owl:TransitiveProperty . + rdfs:subClassOf a owl:TransitiveProperty . + } + } ; + +RDFS_RULE_SET ('urn:kbpedia:comedian:owl:equivalent:class:subproperty:inference:rules', 'https://github.com/Cognonto/kbpedia/raw/master/versions/2.50/kbpedia_reference_concepts.zip') ; + +SELECT * +FROM DB.DBA.SYS_RDF_SCHEMA +WHERE RS_NAME = 'urn:kbpedia:comedian:owl:equivalent:class:subproperty:inference:rules' ; + +-- Tests + +-- 1.1 Test using class kbpedia:Comedian + + +SPARQL +DEFINE input:inference 'urn:kbpedia:comedian:owl:equivalent:class:subproperty:inference:rules' +PREFIX kbpedia: + +SELECT COUNT(*) +WHERE { + ?s a kbpedia:Comedian . + } ; + + +-- Test 1.2: without reasoning + +SPARQL +# DEFINE input:inference 'urn:kbpedia:comedian:owl:equivalent:class:subproperty:inference:rules' +PREFIX kbpedia: + +SELECT COUNT(*) +WHERE { + ?s a kbpedia:Comedian . + } ; + +-- Tests + +-- 2.1 Test using class wdt:Q245068 + +SPARQL +DEFINE input:inference 'urn:kbpedia:comedian:owl:equivalent:class:subproperty:inference:rules' +PREFIX wd: + +SELECT COUNT(*) +WHERE { + ?s a wd:Q245068 . + } ; + +-- Test 2.2: without reasoning +SPARQL +# DEFINE input:inference 'urn:kbpedia:comedian:owl:equivalent:class:subproperty:inference:rules' +PREFIX wd: + +SELECT COUNT(*) +WHERE { + ?s a wd:Q245068 . + } ; \ No newline at end of file diff --git a/reasoning-and-inference/built-in-reasoning-and-inference-kb-mime-artist.sql b/reasoning-and-inference/built-in-reasoning-and-inference-kb-mime-artist.sql new file mode 100755 index 0000000..af6a50b --- /dev/null +++ b/reasoning-and-inference/built-in-reasoning-and-inference-kb-mime-artist.sql @@ -0,0 +1,170 @@ +SPARQL CLEAR GRAPH ; +SPARQL CLEAR GRAPH ; +SPARQL CLEAR GRAPH ; + +--KBpedia Tbox (Terminology Box) + +SPARQL + +PREFIX wdt: +PREFIX wd: +PREFIX kbpedia: + +INSERT INTO GRAPH +{ + ?class a ?o +} + +WHERE + { + SERVICE + { + SELECT * + #FROM + WHERE + { + ?class a ?o. + FILTER (?class = kbpedia:Mime-Actor). + } + } + + }; + +-- Wikidata Tbox (Terminology Box) + +SPARQL + +PREFIX wd: +PREFIX wdt: +PREFIX kbpedia: +INSERT INTO GRAPH +{ + ?class a ?o +} + +WHERE + { + SERVICE + { + SELECT * + #FROM + WHERE + { + ?class a ?o. + FILTER (?class = wd:Q674067). + } + } + + }; + +-- Wikidata Abox (Assertions Box) + +SPARQL +PREFIX wd: +PREFIX wdt: +PREFIX kbpedia: +INSERT INTO GRAPH +{ + ?entity ?p ?class +} + +WHERE + { + SERVICE + { + SELECT * + WHERE + { + ?entity ?p ?class. + FILTER (?p = wdt:P106 && ?class = wd:Q674067). + } + LIMIT 100 + } + + }; + +-- Built-in inference rules + +DELETE +FROM DB.DBA.SYS_RDF_SCHEMA +WHERE RS_NAME = 'urn:kbpedia:mime-artist:owl:equivalent:class:subproperty:inference:rules' ; + + +SPARQL +PREFIX wd: +PREFIX wdt: +PREFIX owl: +PREFIX rdfs: +PREFIX kbpedia: +INSERT { + GRAPH + { + kbpedia:Mime-Actor owl:equivalentClass wd:Q674067 . + wdt:P106 rdfs:subPropertyOf rdf:type . + owl:equivalentProperty a owl:TransitiveProperty . + owl:equivalentClass a owl:TransitiveProperty. + rdfs:subPropertyOf a owl:TransitiveProperty . + rdfs:subClassOf a owl:TransitiveProperty . + } + } ; + +RDFS_RULE_SET ('urn:kbpedia:mime-artist:owl:equivalent:class:subproperty:inference:rules', 'https://github.com/Cognonto/kbpedia/raw/master/versions/2.50/kbpedia_reference_concepts.zip') ; + +SELECT * +FROM DB.DBA.SYS_RDF_SCHEMA +WHERE RS_NAME = 'urn:kbpedia:mime-artist:owl:equivalent:class:subproperty:inference:rules' ; + +-- Tests + +-- 1.1 Test using class kbpedia:Mime-Actor + + +SPARQL +DEFINE input:inference 'urn:kbpedia:mime-artist:owl:equivalent:class:subproperty:inference:rules' + + +PREFIX kbpedia: + + +SELECT COUNT(*) +WHERE { + ?s a kbpedia:Mime-Actor . + } ; + + +-- Test 1.2: without reasoning + +SPARQL +# DEFINE input:inference 'urn:kbpedia:mime-artist:owl:equivalent:class:subproperty:inference:rules' + +PREFIX kbpedia: + +SELECT COUNT(*) +WHERE { + ?s a kbpedia:Mime-Actor . + } ; + +-- Tests + +-- 2.1 Test using class wdt:Q674067 + +SPARQL +DEFINE input:inference 'urn:kbpedia:mime-artist:owl:equivalent:class:subproperty:inference:rules' + +PREFIX wd: + +SELECT COUNT(*) +WHERE { + ?s a wd:Q674067 . + } ; + +-- Test 2.2: without reasoning +SPARQL +# DEFINE input:inference 'urn:kbpedia:mime-artist:owl:equivalent:class:subproperty:inference:rules' +PREFIX wd: + + +SELECT COUNT(*) +WHERE { + ?s a wd:Q674067 . + } ; \ No newline at end of file diff --git a/reasoning-and-inference/built-in-reasoning-and-inference-kb-philosopher.sql b/reasoning-and-inference/built-in-reasoning-and-inference-kb-philosopher.sql new file mode 100755 index 0000000..8c76240 --- /dev/null +++ b/reasoning-and-inference/built-in-reasoning-and-inference-kb-philosopher.sql @@ -0,0 +1,216 @@ +SPARQL CLEAR GRAPH ; +SPARQL CLEAR GRAPH ; +SPARQL CLEAR GRAPH ; + +--KBpedia Tbox (Terminology Box) + +SPARQL +PREFIX wd: +PREFIX wdt: +PREFIX owl: +PREFIX rdfs: + +PREFIX kbpedia: + +INSERT INTO GRAPH +{ + ?class a ?o +} + +WHERE + { + SERVICE + { + SELECT * + FROM + WHERE + { + ?class a ?o. + FILTER (?class = kbpedia:Philosopher). + } + } + + }; + +-- Wikidata Tbox (Terminology Box) + +SPARQL +PREFIX wd: +PREFIX wdt: +PREFIX owl: +PREFIX rdfs: +PREFIX kbpedia: + +INSERT INTO GRAPH +{ + ?class a ?o +} + +WHERE + { + SERVICE + { + SELECT * + #FROM + WHERE + { + ?class a ?o. + FILTER (?class = wd:Q4964182). + } + } + + }; + +-- Wikidata Abox (Assertions Box) + +SPARQL +PREFIX wd: +PREFIX wdt: +PREFIX owl: +PREFIX rdfs: +PREFIX kbpedia: + +INSERT INTO GRAPH +{ + ?entity ?p ?class +} + +WHERE + { + SERVICE + { + SELECT * + WHERE + { + ?entity ?p ?class. + FILTER (?p = wdt:P106 && ?class = wd:Q4964182). + } + LIMIT 100 + } + + }; + +SPARQL +CLEAR GRAPH ; +DELETE +FROM DB.DBA.SYS_RDF_SCHEMA +WHERE RS_NAME = 'urn:kbpedia:philosopher:owl:equivalent:class:subproperty:inference:rules' ; + +SPARQL +PREFIX wd: +PREFIX kbpedia: + +DELETE { + GRAPH + { + wd:Q4964182 owl:equivalentClass kbpedia:Philosopher . + + } + } ; + +SPARQL +PREFIX wd: +PREFIX wdt: +PREFIX owl: +PREFIX rdfs: +PREFIX kbpedia: + +INSERT { + GRAPH + { + kbpedia:Philosopher owl:equivalentClass wd:Q4964182 . + #wd:Q4964182 owl:equivalentClass kbpedia:Philosopher . + wdt:P106 rdfs:subPropertyOf rdf:type . + owl:equivalentProperty a owl:TransitiveProperty . + owl:equivalentClass a owl:TransitiveProperty. + rdfs:subPropertyOf a owl:TransitiveProperty . + rdfs:subClassOf a owl:TransitiveProperty . + } + } ; + +RDFS_RULE_SET ('urn:kbpedia:philosopher:owl:equivalent:class:subproperty:inference:rules', 'https://github.com/Cognonto/kbpedia/raw/master/versions/2.50/kbpedia_reference_concepts.zip') ; + +SELECT * +FROM DB.DBA.SYS_RDF_SCHEMA +WHERE RS_NAME = 'urn:kbpedia:philosopher:owl:equivalent:class:subproperty:inference:rules' ; + +-- Tests + +-- 1.1 Test using class kbpedia:Philosopher + + +SPARQL +DEFINE input:inference 'urn:kbpedia:philosopher:owl:equivalent:class:subproperty:inference:rules' + +PREFIX wd: +PREFIX wdt: +PREFIX owl: +PREFIX rdfs: +PREFIX bmo: +PREFIX schema: +PREFIX foaf: +PREFIX kbpedia: + + +SELECT COUNT(*) +WHERE { + ?s a kbpedia:Philosopher . + } ; + + +-- Test 1.2: without reasoning + +SPARQL +# DEFINE input:inference 'urn:kbpedia:philosopher:owl:equivalent:class:subproperty:inference:rules' +PREFIX wd: +PREFIX wdt: +PREFIX owl: +PREFIX rdfs: +PREFIX bmo: +PREFIX schema: +PREFIX foaf: +PREFIX kbpedia: + +SELECT COUNT(*) +WHERE { + ?s a kbpedia:Philosopher . + } ; + +-- Tests + +-- 2.1 Test using class wdt:Q4964182 + +SPARQL +DEFINE input:inference 'urn:kbpedia:philosopher:owl:equivalent:class:subproperty:inference:rules' + +PREFIX wd: +PREFIX wdt: +PREFIX owl: +PREFIX rdfs: +PREFIX bmo: +PREFIX schema: +PREFIX foaf: +PREFIX kbpedia: + + +SELECT COUNT(*) +WHERE { + ?s a wd:Q4964182 . + } ; + +-- Test 2.2: without reasoning +SPARQL +# DEFINE input:inference 'urn:kbpedia:philosopher:owl:equivalent:class:subproperty:inference:rules' +PREFIX wd: +PREFIX wdt: +PREFIX owl: +PREFIX rdfs: +PREFIX bmo: +PREFIX schema: +PREFIX foaf: +PREFIX kbpedia: + +SELECT COUNT(*) +WHERE { + ?s a wd:Q4964182 . + } ; \ No newline at end of file diff --git a/reasoning-and-inference/built-in-reasoning-and-inference-kb-stage-actor.sql b/reasoning-and-inference/built-in-reasoning-and-inference-kb-stage-actor.sql new file mode 100755 index 0000000..843d51e --- /dev/null +++ b/reasoning-and-inference/built-in-reasoning-and-inference-kb-stage-actor.sql @@ -0,0 +1,183 @@ +SPARQL CLEAR GRAPH ; +SPARQL CLEAR GRAPH ; +SPARQL CLEAR GRAPH ; + +--KBpedia Tbox (Terminology Box) + + +SPARQL + +PREFIX wdt: +PREFIX wd: +PREFIX kbpedia: + +INSERT INTO GRAPH +{ + ?class a ?o +} + +WHERE + { + SERVICE + { + SELECT * + #FROM + WHERE + { + ?class a ?o. + FILTER (?class = kbpedia:ActorInPlays). + } + } + + }; + +-- Wikidata Tbox (Terminology Box) + +SPARQL + +PREFIX wd: +PREFIX wdt: +PREFIX kbpedia: +INSERT INTO GRAPH +{ + ?class a ?o +} + +WHERE + { + SERVICE + { + SELECT * + #FROM + WHERE + { + ?class a ?o. + FILTER (?class = wd:Q2259451). + } + } + + }; + +-- Wikidata Abox (Assertions Box) + +SPARQL +PREFIX wd: +PREFIX wdt: +PREFIX kbpedia: +INSERT INTO GRAPH +{ + ?entity ?p ?class +} + +WHERE + { + SERVICE + { + SELECT * + WHERE + { + ?entity ?p ?class. + FILTER (?p = wdt:P106 && ?class = wd:Q2259451). + } + LIMIT 100 + } + + }; + +-- Built-in inference rules + +SPARQL +CLEAR GRAPH ; +DELETE +FROM DB.DBA.SYS_RDF_SCHEMA +WHERE RS_NAME = 'urn:kbpedia:stage-actor:owl:equivalent:class:subproperty:inference:rules' ; + +SPARQL +PREFIX wd: +PREFIX wdt: +PREFIX owl: +PREFIX rdfs: +PREFIX kbpedia: +DELETE { + GRAPH + { + #kbpedia:ActorInPlays owl:equivalentClass wd:Q2259451 . + wd:Q2259451 owl:equivalentClass kbpedia:ActorInPlays . + } + } ; + +SPARQL +PREFIX wd: +PREFIX wdt: +PREFIX owl: +PREFIX rdfs: +PREFIX kbpedia: +INSERT { + GRAPH + { + kbpedia:ActorInPlays owl:equivalentClass wd:Q2259451 . + wdt:P106 rdfs:subPropertyOf rdf:type . + owl:equivalentProperty a owl:TransitiveProperty . + owl:equivalentClass a owl:TransitiveProperty. + rdfs:subPropertyOf a owl:TransitiveProperty . + rdfs:subClassOf a owl:TransitiveProperty . + } + } ; + +RDFS_RULE_SET ('urn:kbpedia:stage-actor:owl:equivalent:class:subproperty:inference:rules', 'https://github.com/Cognonto/kbpedia/raw/master/versions/2.50/kbpedia_reference_concepts.zip') ; + +SELECT * +FROM DB.DBA.SYS_RDF_SCHEMA +WHERE RS_NAME = 'urn:kbpedia:stage-actor:owl:equivalent:class:subproperty:inference:rules' ; + +-- Tests + +-- 1.1 Test using class kbpedia:ActorInPlays + + +SPARQL +DEFINE input:inference 'urn:kbpedia:stage-actor:owl:equivalent:class:subproperty:inference:rules' +PREFIX kbpedia: + + +SELECT COUNT(*) +WHERE { + ?s a kbpedia:ActorInPlays . + } ; + + +-- Test 1.2: without reasoning + +SPARQL +# DEFINE input:inference 'urn:kbpedia:stage-actor:owl:equivalent:class:subproperty:inference:rules' +PREFIX kbpedia: + +SELECT COUNT(*) +WHERE { + ?s a kbpedia:ActorInPlays . + } ; + +-- Tests + +-- 2.1 Test using class wdt:Q2259451 + +SPARQL +DEFINE input:inference 'urn:kbpedia:stage-actor:owl:equivalent:class:subproperty:inference:rules' +PREFIX wd: + + + +SELECT COUNT(*) +WHERE { + ?s a wd:Q2259451 . + } ; + +-- Test 2.2: without reasoning +SPARQL +# DEFINE input:inference 'urn:kbpedia:stage-actor:owl:equivalent:class:subproperty:inference:rules' +PREFIX wd: + +SELECT COUNT(*) +WHERE { + ?s a wd:Q2259451 . + } ; \ No newline at end of file diff --git a/reasoning-and-inference/kbpedia-comedian-inference-rules.sql b/reasoning-and-inference/kbpedia-comedian-inference-rules.sql old mode 100644 new mode 100755 index f7ee522..72dfee8 --- a/reasoning-and-inference/kbpedia-comedian-inference-rules.sql +++ b/reasoning-and-inference/kbpedia-comedian-inference-rules.sql @@ -1,144 +1,112 @@ -SPARQL CLEAR GRAPH ; -SPARQL CLEAR GRAPH ; -SPARQL CLEAR GRAPH ; - --- Built-in inference rules - -DELETE -FROM DB.DBA.SYS_RDF_SCHEMA -WHERE RS_NAME = 'urn:kbpedia:comedian:owl:equivalent:class:subproperty:inference:rules' ; - - -SPARQL - -PREFIX wdt: -PREFIX wd: -PREFIX kbpedia: - -INSERT { - GRAPH - { - kbpedia:Comedian owl:equivalentClass wdt:Q245068 . - wd:P106 rdfs:subPropertyOf rdf:type . - owl:equivalentProperty a owl:TransitiveProperty . - owl:equivalentClass a owl:TransitiveProperty. - rdfs:subPropertyOf a owl:TransitiveProperty . - rdfs:subClassOf a owl:TransitiveProperty . - } - } ; - -RDFS_RULE_SET ('urn:kbpedia:comedian:owl:equivalent:class:subproperty:inference:rules', 'https://github.com/Cognonto/kbpedia/raw/master/versions/2.50/kbpedia_reference_concepts.zip') ; - -SELECT * -FROM DB.DBA.SYS_RDF_SCHEMA -WHERE RS_NAME = 'urn:kbpedia:comedian:owl:equivalent:class:subproperty:inference:rules' ; - --- Tests - --- 1.1 Test using class kbpedia:Comedian - - -SPARQL -DEFINE input:inference 'urn:kbpedia:comedian:owl:equivalent:class:subproperty:inference:rules' - -PREFIX owl: -PREFIX rdfs: -PREFIX bmo: -PREFIX schema: -PREFIX foaf: -PREFIX kbpedia: - - -SELECT COUNT(*) -WHERE { - ?s a kbpedia:Comedian . - } ; - - --- Test 1.2: without reasoning - -SPARQL -# DEFINE input:inference 'urn:kbpedia:comedian:owl:equivalent:class:subproperty:inference:rules' -PREFIX owl: -PREFIX rdfs: -PREFIX bmo: -PREFIX schema: -PREFIX foaf: -PREFIX kbpedia: - -SELECT COUNT(*) -WHERE { - ?s a kbpedia:Comedian . - } ; - --- Tests - --- 2.1 Test using class wdt:Q245068 - -SPARQL -DEFINE input:inference 'urn:kbpedia:comedian:owl:equivalent:class:subproperty:inference:rules' - -PREFIX owl: -PREFIX rdfs: -PREFIX bmo: -PREFIX schema: -PREFIX foaf: -PREFIX kbpedia: -PREFIX wdt: - - -SELECT COUNT(*) -WHERE { - ?s a wdt:Q245068 . - } ; - --- Test 2.2: without reasoning -SPARQL -# DEFINE input:inference 'urn:kbpedia:comedian:owl:equivalent:class:subproperty:inference:rules' -PREFIX owl: -PREFIX rdfs: -PREFIX bmo: -PREFIX schema: -PREFIX foaf: -PREFIX kbpedia: - -SELECT COUNT(*) -WHERE { - ?s a wdt:Q245068 . - } ; - --- 3.1 Test using class wdt:Q245068 - -SPARQL -DEFINE input:inference 'urn:kbpedia:comedian:owl:equivalent:class:subproperty:inference:rules' - -PREFIX owl: -PREFIX rdfs: -PREFIX bmo: -PREFIX schema: -PREFIX foaf: -PREFIX kbpedia: -PREFIX wdt: - - -SELECT * -WHERE { - ?s a wdt:Q245068 . - } -LIMIT 100 ; - --- Test 3.2: without reasoning -SPARQL -# DEFINE input:inference 'urn:kbpedia:comedian:owl:equivalent:class:subproperty:inference:rules' -PREFIX owl: -PREFIX rdfs: -PREFIX bmo: -PREFIX schema: -PREFIX foaf: -PREFIX kbpedia: - -SELECT * -WHERE { - ?s a wdt:Q245068 . - } -LIMIT 100 ; \ No newline at end of file +SPARQL CLEAR GRAPH ; +SPARQL CLEAR GRAPH ; +SPARQL CLEAR GRAPH ; + +-- Built-in inference rules + +DELETE +FROM DB.DBA.SYS_RDF_SCHEMA +WHERE RS_NAME = 'urn:kbpedia:comedian:owl:equivalent:class:subproperty:inference:rules' ; + +SPARQL +DELETE { + GRAPH + { + # owl:equivalentClass . + owl:equivalentClass . + + } + } ; + +SPARQL +INSERT { + GRAPH + { + owl:equivalentClass . + # owl:equivalentClass . + rdfs:subPropertyOf rdf:type . + owl:equivalentProperty a owl:TransitiveProperty . + owl:equivalentClass a owl:TransitiveProperty. + rdfs:subPropertyOf a owl:TransitiveProperty . + rdfs:subClassOf a owl:TransitiveProperty . + } + } ; + +RDFS_RULE_SET ('urn:kbpedia:comedian:owl:equivalent:class:subproperty:inference:rules', 'https://github.com/Cognonto/kbpedia/raw/master/versions/2.50/kbpedia_reference_concepts.zip') ; + +SELECT * +FROM DB.DBA.SYS_RDF_SCHEMA +WHERE RS_NAME = 'urn:kbpedia:comedian:owl:equivalent:class:subproperty:inference:rules' ; + +-- Tests + +-- 1.1 Test using class kbpedia:Comedian + + +SPARQL +DEFINE input:inference 'urn:kbpedia:comedian:owl:equivalent:class:subproperty:inference:rules' + +PREFIX owl: +PREFIX rdfs: +PREFIX bmo: +PREFIX schema: +PREFIX foaf: +PREFIX kbpedia: + + +SELECT COUNT(*) +WHERE { + ?s a kbpedia:Comedian . + } ; + + +-- Test 1.2: without reasoning + +SPARQL +# DEFINE input:inference 'urn:kbpedia:comedian:owl:equivalent:class:subproperty:inference:rules' +PREFIX owl: +PREFIX rdfs: +PREFIX bmo: +PREFIX schema: +PREFIX foaf: +PREFIX kbpedia: + +SELECT COUNT(*) +WHERE { + ?s a kbpedia:Comedian . + } ; + +-- Tests + +-- 2.1 Test using class wdt:Q245068 + +SPARQL +DEFINE input:inference 'urn:kbpedia:comedian:owl:equivalent:class:subproperty:inference:rules' + +PREFIX owl: +PREFIX rdfs: +PREFIX bmo: +PREFIX schema: +PREFIX foaf: +PREFIX kbpedia: + + +SELECT COUNT(*) +WHERE { + ?s a . + } ; + +-- Test 2.2: without reasoning +SPARQL +# DEFINE input:inference 'urn:kbpedia:comedian:owl:equivalent:class:subproperty:inference:rules' +PREFIX owl: +PREFIX rdfs: +PREFIX bmo: +PREFIX schema: +PREFIX foaf: +PREFIX kbpedia: + +SELECT COUNT(*) +WHERE { + ?s a . + } ; \ No newline at end of file diff --git a/reasoning-and-inference/kbpedia-stage-actor-inference-rules.sql b/reasoning-and-inference/kbpedia-stage-actor-inference-rules.sql new file mode 100755 index 0000000..a9ac80e --- /dev/null +++ b/reasoning-and-inference/kbpedia-stage-actor-inference-rules.sql @@ -0,0 +1,112 @@ +SPARQL CLEAR GRAPH ; +SPARQL CLEAR GRAPH ; +SPARQL CLEAR GRAPH ; + +-- Built-in inference rules + +DELETE +FROM DB.DBA.SYS_RDF_SCHEMA +WHERE RS_NAME = 'urn:kbpedia:stage-actor:owl:equivalent:class:subproperty:inference:rules' ; + +SPARQL +DELETE { + GRAPH + { + # owl:equivalentClass . + owl:equivalentClass . + + } + } ; + +SPARQL +INSERT { + GRAPH + { + owl:equivalentClass . + # owl:equivalentClass . + rdfs:subPropertyOf rdf:type . + owl:equivalentProperty a owl:TransitiveProperty . + owl:equivalentClass a owl:TransitiveProperty. + rdfs:subPropertyOf a owl:TransitiveProperty . + rdfs:subClassOf a owl:TransitiveProperty . + } + } ; + +RDFS_RULE_SET ('urn:kbpedia:stage-actor:owl:equivalent:class:subproperty:inference:rules', 'https://github.com/Cognonto/kbpedia/raw/master/versions/2.50/kbpedia_reference_concepts.zip') ; + +SELECT * +FROM DB.DBA.SYS_RDF_SCHEMA +WHERE RS_NAME = 'urn:kbpedia:stage-actor:owl:equivalent:class:subproperty:inference:rules' ; + +-- Tests + +-- 1.1 Test using class kbpedia:Comedian + + +SPARQL +DEFINE input:inference 'urn:kbpedia:stage-actor:owl:equivalent:class:subproperty:inference:rules' + +PREFIX owl: +PREFIX rdfs: +PREFIX bmo: +PREFIX schema: +PREFIX foaf: +PREFIX kbpedia: + + +SELECT COUNT(*) +WHERE { + ?s a kbpedia:Comedian . + } ; + + +-- Test 1.2: without reasoning + +SPARQL +# DEFINE input:inference 'urn:kbpedia:stage-actor:owl:equivalent:class:subproperty:inference:rules' +PREFIX owl: +PREFIX rdfs: +PREFIX bmo: +PREFIX schema: +PREFIX foaf: +PREFIX kbpedia: + +SELECT COUNT(*) +WHERE { + ?s a kbpedia:Comedian . + } ; + +-- Tests + +-- 2.1 Test using class wdt:Q2259451 + +SPARQL +DEFINE input:inference 'urn:kbpedia:stage-actor:owl:equivalent:class:subproperty:inference:rules' + +PREFIX owl: +PREFIX rdfs: +PREFIX bmo: +PREFIX schema: +PREFIX foaf: +PREFIX kbpedia: + + +SELECT COUNT(*) +WHERE { + ?s a . + } ; + +-- Test 2.2: without reasoning +SPARQL +# DEFINE input:inference 'urn:kbpedia:stage-actor:owl:equivalent:class:subproperty:inference:rules' +PREFIX owl: +PREFIX rdfs: +PREFIX bmo: +PREFIX schema: +PREFIX foaf: +PREFIX kbpedia: + +SELECT COUNT(*) +WHERE { + ?s a . + } ; \ No newline at end of file