w3c / activitystreams

Activity Streams 2.0
https://www.w3.org/TR/activitystreams-core/
Other
276 stars 61 forks source link

fix: de-duplicate OWL unions #518

Open tpluscode opened 3 years ago

tpluscode commented 3 years ago

This combines all occurrences of owl:unionOf blank node types which are used more than once.

Why? Consider the data below with reasoning enabled. How many types will <foo> have?

<Activity1> as:object <foo> .
<Activity2> as:origin <foo> .
<Activity3> as:target <foo> .
<Activity4> as:actor  <foo> .
<Activity5> as:author <foo> .

Because the same union is a distinct blank node rdfs:range of each of those properties, it will have 5 types, and additional for every usage with another property sharing that same ( as:Link as:Object ) union. Something like

<foo> a [
  a owl:Class ;
  owl:unionOf ( as:Object as:Link ) ;
], [
  a owl:Class ;
  owl:unionOf ( as:Object as:Link ) ;
], [
  a owl:Class ;
  owl:unionOf ( as:Object as:Link ) ;
], [
  a owl:Class ;
  owl:unionOf ( as:Object as:Link ) ;
], [
  a owl:Class ;
  owl:unionOf ( as:Object as:Link ) ;
] .

Clearly, this is not desired. By collapsing all this ranges into a single blank node, there will only be one such inferred type triple