jenkins-bot has submitted this change and it was merged.

Change subject: Add importing OWL ontology
......................................................................


Add importing OWL ontology

Bug: T99820
Change-Id: I729d9823a1616008acb808adf7a5a21fe94d8670
---
M repo/includes/rdf/RdfBuilder.php
M repo/includes/rdf/RdfVocabulary.php
M repo/tests/phpunit/data/maintenance/dumpRdf-out.txt
M repo/tests/phpunit/data/rdf/RdfDumpGenerator/empty.nt
M repo/tests/phpunit/data/rdf/RdfDumpGenerator/entities.nt
M repo/tests/phpunit/data/rdf/RdfDumpGenerator/redirect.nt
M repo/tests/phpunit/data/rdf/RdfDumpGenerator/refs.nt
M repo/tests/phpunit/data/rdf/dumpheader.nt
8 files changed, 24 insertions(+), 1 deletion(-)

Approvals:
  Daniel Kinzler: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/repo/includes/rdf/RdfBuilder.php b/repo/includes/rdf/RdfBuilder.php
index 4dadc91..0e57457 100644
--- a/repo/includes/rdf/RdfBuilder.php
+++ b/repo/includes/rdf/RdfBuilder.php
@@ -493,9 +493,11 @@
                // TODO: this should point to "this document"
                $this->writer->about( RdfVocabulary::NS_ONTOLOGY, 'Dump' )
                        ->a( RdfVocabulary::NS_SCHEMA_ORG, "Dataset" )
+                       ->a( 'owl', 'Ontology' )
                        ->say( RdfVocabulary::NS_CC, 'license' )->is( 
RdfVocabulary::LICENSE )
                        ->say( RdfVocabulary::NS_SCHEMA_ORG, 'softwareVersion' 
)->value( RdfVocabulary::FORMAT_VERSION )
-                       ->say( RdfVocabulary::NS_SCHEMA_ORG, 'dateModified' 
)->value( wfTimestamp( TS_ISO_8601, $timestamp ), 'xsd', 'dateTime' );
+                       ->say( RdfVocabulary::NS_SCHEMA_ORG, 'dateModified' 
)->value( wfTimestamp( TS_ISO_8601, $timestamp ), 'xsd', 'dateTime' )
+                       ->say( 'owl', 'imports' )->is( 
RdfVocabulary::getOntologyURI() );
        }
 
 }
diff --git a/repo/includes/rdf/RdfVocabulary.php 
b/repo/includes/rdf/RdfVocabulary.php
index 8a8d42b..5a15741 100644
--- a/repo/includes/rdf/RdfVocabulary.php
+++ b/repo/includes/rdf/RdfVocabulary.php
@@ -22,6 +22,7 @@
 
        // Change this when changing data format!
        const FORMAT_VERSION = '0.0.1';
+       const ONTOLOGY_VERSION = '1.0';
 
        const ONTOLOGY_BASE_URI = 'http://wikiba.se/ontology';
        const NS_ONTOLOGY = 'wikibase'; // wikibase ontology (shared)
@@ -253,4 +254,12 @@
                return self::$canonicalLanguageCodeCache[$languageCode];
        }
 
+       /**
+        * Return current ontology version URI
+        * @return string
+        */
+       public static function getOntologyURI() {
+               return self::ONTOLOGY_BASE_URI . "-" . self::ONTOLOGY_VERSION . 
".owl";
+       }
+
 }
diff --git a/repo/tests/phpunit/data/maintenance/dumpRdf-out.txt 
b/repo/tests/phpunit/data/maintenance/dumpRdf-out.txt
index 2ab228a..5509df8 100644
--- a/repo/tests/phpunit/data/maintenance/dumpRdf-out.txt
+++ b/repo/tests/phpunit/data/maintenance/dumpRdf-out.txt
@@ -1,7 +1,9 @@
 <http://wikiba.se/ontology-beta#Dump> 
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/Dataset> .
+<http://wikiba.se/ontology-beta#Dump> 
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type> 
<http://www.w3.org/2002/07/owl#Ontology> .
 <http://wikiba.se/ontology-beta#Dump> <http://creativecommons.org/ns#license> 
<http://creativecommons.org/publicdomain/zero/1.0/> .
 <http://wikiba.se/ontology-beta#Dump> <http://schema.org/softwareVersion> 
"0.0.1" .
 <http://wikiba.se/ontology-beta#Dump> <http://schema.org/dateModified> 
"2015-01-01T00:00:00Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> .
+<http://wikiba.se/ontology-beta#Dump> <http://www.w3.org/2002/07/owl#imports> 
<http://wikiba.se/ontology-1.0.owl> .
 <http://dump.rdf.test/DumpRdfTest/Special:EntityData/Q1> 
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/Dataset> .
 <http://dump.rdf.test/DumpRdfTest/Special:EntityData/Q1> 
<http://schema.org/about> <fooUriQ1> .
 <http://dump.rdf.test/DumpRdfTest/Special:EntityData/Q1> 
<http://schema.org/version> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
diff --git a/repo/tests/phpunit/data/rdf/RdfDumpGenerator/empty.nt 
b/repo/tests/phpunit/data/rdf/RdfDumpGenerator/empty.nt
index 3c4b460..af1c3d6 100644
--- a/repo/tests/phpunit/data/rdf/RdfDumpGenerator/empty.nt
+++ b/repo/tests/phpunit/data/rdf/RdfDumpGenerator/empty.nt
@@ -2,3 +2,5 @@
 <http://wikiba.se/ontology-beta#Dump> <http://schema.org/dateModified> 
"1970-01-12T13:46:40Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> .
 <http://wikiba.se/ontology-beta#Dump> <http://schema.org/softwareVersion> 
"0.0.1" .
 <http://wikiba.se/ontology-beta#Dump> 
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/Dataset> .
+<http://wikiba.se/ontology-beta#Dump> 
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type> 
<http://www.w3.org/2002/07/owl#Ontology> .
+<http://wikiba.se/ontology-beta#Dump> <http://www.w3.org/2002/07/owl#imports> 
<http://wikiba.se/ontology-1.0.owl> .
diff --git a/repo/tests/phpunit/data/rdf/RdfDumpGenerator/entities.nt 
b/repo/tests/phpunit/data/rdf/RdfDumpGenerator/entities.nt
index 0e7a732..87e5e04 100644
--- a/repo/tests/phpunit/data/rdf/RdfDumpGenerator/entities.nt
+++ b/repo/tests/phpunit/data/rdf/RdfDumpGenerator/entities.nt
@@ -44,3 +44,5 @@
 <http://acme.test/prop/reference/value/P10> 
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type> 
<http://www.w3.org/2002/07/owl#ObjectProperty> .
 <http://acme.test/prop/statement/P10> 
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type> 
<http://www.w3.org/2002/07/owl#DatatypeProperty> .
 <http://acme.test/prop/statement/value/P10> 
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type> 
<http://www.w3.org/2002/07/owl#ObjectProperty> .
+<http://wikiba.se/ontology-beta#Dump> 
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type> 
<http://www.w3.org/2002/07/owl#Ontology> .
+<http://wikiba.se/ontology-beta#Dump> <http://www.w3.org/2002/07/owl#imports> 
<http://wikiba.se/ontology-1.0.owl> .
diff --git a/repo/tests/phpunit/data/rdf/RdfDumpGenerator/redirect.nt 
b/repo/tests/phpunit/data/rdf/RdfDumpGenerator/redirect.nt
index 8949294..e7a05a1 100644
--- a/repo/tests/phpunit/data/rdf/RdfDumpGenerator/redirect.nt
+++ b/repo/tests/phpunit/data/rdf/RdfDumpGenerator/redirect.nt
@@ -34,3 +34,5 @@
 <http://acme.test/prop/reference/value/P10> 
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type> 
<http://www.w3.org/2002/07/owl#ObjectProperty> .
 <http://acme.test/prop/statement/P10> 
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type> 
<http://www.w3.org/2002/07/owl#DatatypeProperty> .
 <http://acme.test/prop/statement/value/P10> 
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type> 
<http://www.w3.org/2002/07/owl#ObjectProperty> .
+<http://wikiba.se/ontology-beta#Dump> 
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type> 
<http://www.w3.org/2002/07/owl#Ontology> .
+<http://wikiba.se/ontology-beta#Dump> <http://www.w3.org/2002/07/owl#imports> 
<http://wikiba.se/ontology-1.0.owl> .
diff --git a/repo/tests/phpunit/data/rdf/RdfDumpGenerator/refs.nt 
b/repo/tests/phpunit/data/rdf/RdfDumpGenerator/refs.nt
index f8de459..b637a83 100644
--- a/repo/tests/phpunit/data/rdf/RdfDumpGenerator/refs.nt
+++ b/repo/tests/phpunit/data/rdf/RdfDumpGenerator/refs.nt
@@ -71,3 +71,5 @@
 <http://acme.test/value/1e09d673624819aacd170165aae555a1> 
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type> 
<http://wikiba.se/ontology-beta#QuantityValue> .
 <http://acme.test/value/aad6b70bccf9875ba61d31c767b7f652> 
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type> 
<http://wikiba.se/ontology-beta#GlobecoordinateValue> .
 <http://acme.test/value/ba4fa68a0979e663277b08d93f93705c> 
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type> 
<http://wikiba.se/ontology-beta#TimeValue> .
+<http://wikiba.se/ontology-beta#Dump> 
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type> 
<http://www.w3.org/2002/07/owl#Ontology> .
+<http://wikiba.se/ontology-beta#Dump> <http://www.w3.org/2002/07/owl#imports> 
<http://wikiba.se/ontology-1.0.owl> .
diff --git a/repo/tests/phpunit/data/rdf/dumpheader.nt 
b/repo/tests/phpunit/data/rdf/dumpheader.nt
index 14c9a17..fb3cac8 100644
--- a/repo/tests/phpunit/data/rdf/dumpheader.nt
+++ b/repo/tests/phpunit/data/rdf/dumpheader.nt
@@ -2,3 +2,5 @@
 <http://wikiba.se/ontology-beta#Dump> <http://schema.org/dateModified> 
"2015-03-11T21:51:35Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> .
 <http://wikiba.se/ontology-beta#Dump> <http://schema.org/softwareVersion> 
"0.0.1" .
 <http://wikiba.se/ontology-beta#Dump> 
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/Dataset> .
+<http://wikiba.se/ontology-beta#Dump> 
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type> 
<http://www.w3.org/2002/07/owl#Ontology> .
+<http://wikiba.se/ontology-beta#Dump> <http://www.w3.org/2002/07/owl#imports> 
<http://wikiba.se/ontology-1.0.owl> .

-- 
To view, visit https://gerrit.wikimedia.org/r/246130
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I729d9823a1616008acb808adf7a5a21fe94d8670
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Smalyshev <smalys...@wikimedia.org>
Gerrit-Reviewer: Daniel Kinzler <daniel.kinz...@wikimedia.de>
Gerrit-Reviewer: JanZerebecki <jan.wikime...@zerebecki.de>
Gerrit-Reviewer: Smalyshev <smalys...@wikimedia.org>
Gerrit-Reviewer: Thiemo Mättig (WMDE) <thiemo.maet...@wikimedia.de>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to