Page MenuHomePhabricator

Lexeme/entity schema datatypes are missing from ontology.owl
Closed, ResolvedPublic

Description

Problem:
Looking at https://wikiba.se/ontology, the following property datatypes are missing (example query):

  • wikibase:WikibaseLexeme
  • wikibase:WikibaseForm
  • wikibase:WikibaseSense
  • wikibase:EntitySchema

The following predicate is also missing (example query):

  • wikibase:directClaimNormalized

The AllDisjointClasses section has wikibase:Form but not wikibase:Sense.

Acceptance criteria:

[ ] Lydia has found the checklist for adding a new datatype and makes sure updating the ontology file is included in the checklist

Additional info:

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

Could it be that something else is wrong here? The ontology contains wikibase:Lexeme, wikibase:Form, Wikibase:Sense but the properties refers to the wikibase:Wikibase* form, however, the EntitySchema property refers to the wikibase:EntitySchema one.

What's the difference between the two forms? Should the wikibase:Wikibase* form even exist?

@Nikki I made some edits in the doc here:

The new sections are marked in there, let me know if this works and we will get it up on the ontology page :)

ArthurTaylor renamed this task from Lexeme/entity schema datatypes are missing from ontology.owl to [SW] Lexeme/entity schema datatypes are missing from ontology.owl.Nov 6 2024, 10:40 AM
Lydia_Pintscher renamed this task from [SW] Lexeme/entity schema datatypes are missing from ontology.owl to Lexeme/entity schema datatypes are missing from ontology.owl.Nov 11 2024, 10:54 AM

I looked for the checklist but can't find it.

I created an EntitySchema ontology per T371196, and this document is then the combined ontology of Wikibase, WikibaseLexeme and EntitySchema:

Would be great if you could review this, @Lydia_Pintscher , before we try and make it live on the site.

Thanks, Arthur! Can we please keep the source at the top of the file so that we know where individual pieces of the file come from? But the rest looks good pending the new EntitySchema wikibase:propertyType value name

Can we clarify what this is stalled on please?
This is becoming time sensitive.

Seems to be waiting on T371196, which is waiting on T380976

Seems to be waiting on T371196, which is waiting on T380976

Partially yes, but I think we can also update WikibaseLexeme’s ontology.owl in parallel. (Edit: and Wikibase’s.)

Change #1135064 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/WikibaseLexeme@master] ontology: Fix indentation

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

Change #1135065 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/WikibaseLexeme@master] ontology: Add Wikibase:WikibaseLexeme, Wikibase:WikibaseForm, Wikibase:WikibaseSense

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

Change #1135068 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/Wikibase@master] ontology: Fix indentation

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

Change #1135069 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/Wikibase@master] ontology: Add wikibase:directClaimNormalized

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

Change #1135068 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] ontology: Fix indentation

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

Change #1135064 merged by jenkins-bot:

[mediawiki/extensions/WikibaseLexeme@master] ontology: Fix indentation

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

Change #1135065 merged by jenkins-bot:

[mediawiki/extensions/WikibaseLexeme@master] ontology: Add Wikibase:WikibaseLexeme, Wikibase:WikibaseForm, Wikibase:WikibaseSense

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

Change #1135069 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] ontology: Add wikibase:directClaimNormalized

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

Lucas_Werkmeister_WMDE changed the task status from Open to Stalled.Apr 14 2025, 9:14 AM

The AllDisjointClasses section has wikibase:Form but not wikibase:Sense.

It’s not clear to me where that even comes from… did we just add that to the merged ontology file manually without it being part of any of the Git-tracked ontology files?


Stalled now until T371196 is done, I think.

Arian_Bozorg changed the task status from Stalled to Open.Apr 29 2025, 8:18 AM

some kind of deployment is needed, so brought back to the ready for dev column to acknowledge that there is work still to be done. (the waiting for deploy is a passive column for after the deployment window has been arranged)

file needs to be created then can send it to Jon Amar

Here’s a new merged ontology file for review:

Differences to the current one, excluding whitespace:

git diff --no-index -w ontology-{old,new}.owl
diff --git 1/ontology-old.owl 2/ontology-new.owl
index 7022a2dac8..34499c6863 100644
--- 1/ontology-old.owl
+++ 2/ontology-new.owl
@@ -5,6 +5,7 @@
 // Sources:
 // https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Wikibase/+/refs/heads/master/docs/ontology.owl
 // https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/WikibaseLexeme/+/refs/heads/master/docs/ontology.owl
+// https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/EntitySchema/+/refs/heads/master/docs/ontology.owl
 ///////////////////////////////////////////////////////////////////////////////////////
 -->
 
@@ -30,6 +31,7 @@
     <rdfs:comment>The system ontology of Wikibase</rdfs:comment>
     <rdfs:seeAlso rdf:resource="https://www.mediawiki.org/wiki/Wikibase/Indexing/RDF_Dump_Format" />
     <rdfs:seeAlso rdf:resource="https://www.mediawiki.org/wiki/Extension:WikibaseLexeme/RDF_mapping" />
+    <rdfs:seeAlso rdf:resource="https://www.mediawiki.org/wiki/Extension:EntitySchema/RDF_mapping" />
     <cc:licence rdf:resource="http://creativecommons.org/publicdomain/zero/1.0/" />
   </owl:Ontology>
 
@@ -259,6 +261,12 @@
     <rdfs:domain rdf:resource="&wikibase;Property"/>
   </owl:ObjectProperty>
 
+  <owl:ObjectProperty rdf:about="&wikibase;directClaimNormalized">
+    <rdfs:label>directClaimNormalized</rdfs:label>
+    <rdfs:comment>Link between Wikibase Property and normalized direct claim predicate.</rdfs:comment>
+    <rdfs:domain rdf:resource="&wikibase;Property"/>
+  </owl:ObjectProperty>
+
   <owl:ObjectProperty rdf:about="&wikibase;claim">
     <rdfs:label>claim</rdfs:label>
     <rdfs:comment>Link between Wikibase Property and claim predicate.</rdfs:comment>
@@ -438,20 +446,20 @@
   <!--
   ///////////////////////////////////////////////////////////////////////////////////////
   //
-  // Wikibase Lexeme classes and properties
+  // WikibaseLexeme Classes
   //
   ///////////////////////////////////////////////////////////////////////////////////////
   -->
 
   <owl:Class rdf:about="&wikibase;Lexeme">
     <rdfs:label>Lexeme</rdfs:label>
-    <rdfs:comment>Wikibase Lexeme.</rdfs:comment>
+    <rdfs:comment>Wikibase lexeme.</rdfs:comment>
     <rdfs:subClassOf rdf:resource="&wikibase;Entity"/>
   </owl:Class>
 
   <owl:Class rdf:about="&wikibase;Form">
     <rdfs:label>Form</rdfs:label>
-      <rdfs:comment>Wikibase Form.</rdfs:comment>
+    <rdfs:comment>Wikibase form.</rdfs:comment>
     <rdfs:subClassOf rdf:resource="&wikibase;Entity"/>
   </owl:Class>
 
@@ -461,6 +469,14 @@
     <rdfs:subClassOf rdf:resource="&wikibase;Entity"/>
   </owl:Class>
 
+  <!--
+  ///////////////////////////////////////////////////////////////////////////////////////
+  //
+  // WikibaseLexeme Properties
+  //
+  ///////////////////////////////////////////////////////////////////////////////////////
+  -->
+
   <owl:ObjectProperty rdf:about="&wikibase;lexicalCategory">
     <rdfs:label>lexicalCategory</rdfs:label>
     <rdfs:comment>Lexeme lexical category.</rdfs:comment>
@@ -482,6 +498,48 @@
     <rdfs:range rdf:resource="&rdf;langString"/>
   </owl:DatatypeProperty>
 
+  <!--
+  ///////////////////////////////////////////////////////////////////////////////////////
+  //
+  // WikibaseLexeme Individuals
+  //
+  ///////////////////////////////////////////////////////////////////////////////////////
+  -->
+
+  <!-- Individual property types added by WikibaseLexeme -->
+
+  <owl:NamedIndividual rdf:about="&wikibase;WikibaseLexeme">
+    <rdfs:label>WikibaseLexeme</rdfs:label>
+    <rdfs:comment>Type for referring to a Wikibase Lexeme.</rdfs:comment>
+    <rdf:type rdf:resource="&wikibase;PropertyType"/>
+  </owl:NamedIndividual>
+
+  <owl:NamedIndividual rdf:about="&wikibase;WikibaseForm">
+    <rdfs:label>WikibaseForm</rdfs:label>
+    <rdfs:comment>Type for referring to a Wikibase Form.</rdfs:comment>
+    <rdf:type rdf:resource="&wikibase;PropertyType"/>
+  </owl:NamedIndividual>
+
+  <owl:NamedIndividual rdf:about="&wikibase;WikibaseSense">
+    <rdfs:label>WikibaseSense</rdfs:label>
+    <rdfs:comment>Type for referring to a Wikibase Sense.</rdfs:comment>
+    <rdf:type rdf:resource="&wikibase;PropertyType"/>
+  </owl:NamedIndividual>
+
+  <!--
+  ///////////////////////////////////////////////////////////////////////////////////////
+  //
+  // EntitySchema Individuals
+  //
+  ///////////////////////////////////////////////////////////////////////////////////////
+  -->
+
+  <owl:NamedIndividual rdf:about="&wikibase;WikibaseEntitySchema">
+    <rdfs:label>EntitySchema</rdfs:label>
+    <rdfs:comment>Type for referring to an EntitySchema</rdfs:comment>
+    <rdf:type rdf:resource="&wikibase;PropertyType"/>
+  </owl:NamedIndividual>
+
   <!--
   ///////////////////////////////////////////////////////////////////////////////////////
   //
@@ -497,6 +555,7 @@
       <rdf:Description rdf:about="&wikibase;Item"/>
       <rdf:Description rdf:about="&wikibase;Lexeme"/>
       <rdf:Description rdf:about="&wikibase;Property"/>
+      <rdf:Description rdf:about="&wikibase;Sense"/>
     </owl:members>
   </rdf:Description>

Here’s a new merged ontology file for review:

Differences to the current one, excluding whitespace:
[…]

We seem to have a hard time deciding whether we want Wikibase form or Wikibase Form (same with Lexeme), but I think this is negligible (in rdfs:comment only).

Looks good to me, let's push this ✅

We seem to have a hard time deciding whether we want Wikibase form or Wikibase Form (same with Lexeme), but I think this is negligible (in rdfs:comment only).

Yeah, I just copied that from the WikibaseLexeme file and decided against re-normalizing it 🤷

I’ll email Jon about deploying the new file.