[MediaWiki-commits] [Gerrit] Add importing OWL ontology - change (mediawiki...Wikibase)

2015-11-23 Thread jenkins-bot (Code Review)
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 @@
  
  .
+ 
 
 .
   
 .
   
"0.0.1" .
   
"2015-01-01T00:00:00Z"^^ .
+  
 .
  
  .
  
  .
  
 "1"^^ .
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 @@
   
"1970-01-12T13:46:40Z"^^ .
   
"0.0.1" .
  
  .
+ 
 
 .
+  


[MediaWiki-commits] [Gerrit] Add importing OWL ontology - change (mediawiki...Wikibase)

2015-10-13 Thread Smalyshev (Code Review)
Smalyshev has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/246130

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
2 files changed, 12 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/30/246130/1

diff --git a/repo/includes/rdf/RdfBuilder.php b/repo/includes/rdf/RdfBuilder.php
index 4255c9c..82b9481 100644
--- a/repo/includes/rdf/RdfBuilder.php
+++ b/repo/includes/rdf/RdfBuilder.php
@@ -498,9 +498,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' )->value( 
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";
+   }
+
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I729d9823a1616008acb808adf7a5a21fe94d8670
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Smalyshev 

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