Skip to content

Commit

Permalink
FIX axiom annotations detection
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco authored and Marco committed Jul 26, 2021
1 parent 8bb9903 commit 25e9c33
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion RDFSharp/Semantics/OWL/Ontology/Data/RDFOntologyData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1341,7 +1341,7 @@ public RDFGraph ToRDFGraph(RDFSemanticsEnums.RDFOntologyInferenceExportBehavior
.UnionWith(this.Annotations.SeeAlso.ReifyToRDFGraph(infexpBehavior, nameof(this.Annotations.SeeAlso)))
.UnionWith(this.Annotations.IsDefinedBy.ReifyToRDFGraph(infexpBehavior, nameof(this.Annotations.IsDefinedBy)))
.UnionWith(this.Annotations.CustomAnnotations.ReifyToRDFGraph(infexpBehavior, nameof(this.Annotations.CustomAnnotations)))
.UnionWith(this.Annotations.AxiomAnnotations.ReifyToRDFGraph(infexpBehavior, nameof(this.Annotations.AxiomAnnotations), ontologyData:this)); //OWL2
.UnionWith(this.Annotations.AxiomAnnotations.ReifyToRDFGraph(infexpBehavior, nameof(this.Annotations.AxiomAnnotations), null, null, this)); //OWL2

return result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1186,7 +1186,7 @@ public RDFGraph ToRDFGraph(RDFSemanticsEnums.RDFOntologyInferenceExportBehavior
.UnionWith(this.Annotations.SeeAlso.ReifyToRDFGraph(infexpBehavior, nameof(this.Annotations.SeeAlso)))
.UnionWith(this.Annotations.IsDefinedBy.ReifyToRDFGraph(infexpBehavior, nameof(this.Annotations.IsDefinedBy)))
.UnionWith(this.Annotations.CustomAnnotations.ReifyToRDFGraph(infexpBehavior, nameof(this.Annotations.CustomAnnotations)))
.UnionWith(this.Annotations.AxiomAnnotations.ReifyToRDFGraph(infexpBehavior, nameof(this.Annotations.AxiomAnnotations))); //OWL2
.UnionWith(this.Annotations.AxiomAnnotations.ReifyToRDFGraph(infexpBehavior, nameof(this.Annotations.AxiomAnnotations), this, null, null)); //OWL2

return result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1283,7 +1283,7 @@ public RDFGraph ToRDFGraph(RDFSemanticsEnums.RDFOntologyInferenceExportBehavior
.UnionWith(this.Annotations.SeeAlso.ReifyToRDFGraph(infexpBehavior, nameof(this.Annotations.SeeAlso)))
.UnionWith(this.Annotations.IsDefinedBy.ReifyToRDFGraph(infexpBehavior, nameof(this.Annotations.IsDefinedBy)))
.UnionWith(this.Annotations.CustomAnnotations.ReifyToRDFGraph(infexpBehavior, nameof(this.Annotations.CustomAnnotations)))
.UnionWith(this.Annotations.AxiomAnnotations.ReifyToRDFGraph(infexpBehavior, nameof(this.Annotations.AxiomAnnotations))); //OWL2
.UnionWith(this.Annotations.AxiomAnnotations.ReifyToRDFGraph(infexpBehavior, nameof(this.Annotations.AxiomAnnotations), null, this, null)); //OWL2

return result;
}
Expand Down
20 changes: 10 additions & 10 deletions RDFSharp/Semantics/OWL/Ontology/RDFOntologyHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1993,7 +1993,7 @@ public static Task<RDFDescribeQueryResult> ApplyToOntologyAsync(this RDFDescribe
/// Gets a graph representation of the given taxonomy, exporting inferences according to the selected behavior [OWL2]
/// </summary>
internal static RDFGraph ReifyToRDFGraph(this RDFOntologyTaxonomy taxonomy, RDFSemanticsEnums.RDFOntologyInferenceExportBehavior infexpBehavior, string taxonomyName,
RDFOntologyModel ontologyModel = null, RDFOntologyData ontologyData=null)
RDFOntologyClassModel ontologyClassModel = null, RDFOntologyPropertyModel ontologyPropertyModel = null, RDFOntologyData ontologyData=null)
{
RDFGraph result = new RDFGraph();

Expand All @@ -2002,7 +2002,7 @@ internal static RDFGraph ReifyToRDFGraph(this RDFOntologyTaxonomy taxonomy, RDFS
//Semantic-based reification
case nameof(RDFOntologyDataMetadata.NegativeAssertions):
case nameof(RDFOntologyAnnotations.AxiomAnnotations):
result = ReifySemanticTaxonomyToGraph(taxonomy, taxonomyName, infexpBehavior, ontologyModel, ontologyData);
result = ReifySemanticTaxonomyToGraph(taxonomy, taxonomyName, infexpBehavior, ontologyClassModel, ontologyPropertyModel, ontologyData);
break;

//List-based reification
Expand All @@ -2021,7 +2021,7 @@ internal static RDFGraph ReifyToRDFGraph(this RDFOntologyTaxonomy taxonomy, RDFS
return result;
}
private static RDFGraph ReifySemanticTaxonomyToGraph(RDFOntologyTaxonomy taxonomy, string taxonomyName, RDFSemanticsEnums.RDFOntologyInferenceExportBehavior infexpBehavior,
RDFOntologyModel ontologyModel = null, RDFOntologyData ontologyData = null)
RDFOntologyClassModel ontologyClassModel = null, RDFOntologyPropertyModel ontologyPropertyModel = null, RDFOntologyData ontologyData = null)
{
RDFGraph result = new RDFGraph();

Expand All @@ -2047,14 +2047,14 @@ void BuildSemanticReification(bool isAxiomAnn, RDFOntologyTaxonomyEntry te, RDFT
//Finds the taxonomy entry represented by the given ID in the ontology taxonomies
RDFOntologyTaxonomyEntry FindTaxonomyEntry(long teID)
=> //ClassModel
ontologyModel?.ClassModel.Relations.SubClassOf.SelectEntryByID(teID) ??
ontologyModel?.ClassModel.Relations.EquivalentClass.SelectEntryByID(teID) ??
ontologyModel?.ClassModel.Relations.DisjointWith.SelectEntryByID(teID) ??
ontologyClassModel?.Relations.SubClassOf.SelectEntryByID(teID) ??
ontologyClassModel?.Relations.EquivalentClass.SelectEntryByID(teID) ??
ontologyClassModel?.Relations.DisjointWith.SelectEntryByID(teID) ??
//PropertyModel
ontologyModel?.PropertyModel.Relations.SubPropertyOf.SelectEntryByID(teID) ??
ontologyModel?.PropertyModel.Relations.EquivalentProperty.SelectEntryByID(teID) ??
ontologyModel?.PropertyModel.Relations.InverseOf.SelectEntryByID(teID) ??
ontologyModel?.PropertyModel.Relations.PropertyDisjointWith.SelectEntryByID(teID) ??
ontologyPropertyModel?.Relations.SubPropertyOf.SelectEntryByID(teID) ??
ontologyPropertyModel?.Relations.EquivalentProperty.SelectEntryByID(teID) ??
ontologyPropertyModel?.Relations.InverseOf.SelectEntryByID(teID) ??
ontologyPropertyModel?.Relations.PropertyDisjointWith.SelectEntryByID(teID) ??
//Data
ontologyData?.Relations.ClassType.SelectEntryByID(teID) ??
ontologyData?.Relations.SameAs.SelectEntryByID(teID) ??
Expand Down

0 comments on commit 25e9c33

Please sign in to comment.