Skip to content

Commit

Permalink
WIP: core: exporters: graphol_iri: export all IRIs known to the project
Browse files Browse the repository at this point in the history
This includes datatypes, facets, and top/bottom IRIs since we want to
support non-graphical IRI.
Note that due to this, when selecting a subset of the diagrams you stll
get the IRIs of those, as there is no way to distinguish between them.
  • Loading branch information
mnamici committed Nov 18, 2024
1 parent e27d563 commit 5379cc5
Showing 1 changed file with 3 additions and 27 deletions.
30 changes: 3 additions & 27 deletions eddy/core/exporters/graphol_iri.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,35 +222,11 @@ def getOntologyDomElement(self):

irisEl = self.getDomElement('iris')
ontologyEl.appendChild(irisEl)
if not self.selectedDiagrams:
for iri in sorted(self.project.iris, key=str):
if ((self.project.existIriOccurrence(iri)
or iri == self.project.ontologyIRI)
and not (iri.isTopBottomEntity()
or iri in self.project.getDatatypeIRIs()
or iri in self.project.constrainingFacets
or iri in self.project.getAnnotationPropertyIRIs())):
iriEl = self.getIriDomElement(iri)
irisEl.appendChild(iriEl)
else:
for iri in sorted(self.project.iris, key=str):
if ((self.project.existIriOccurrence(iri)
or iri == self.project.ontologyIRI)
and not (iri.isTopBottomEntity()
or iri in self.project.getDatatypeIRIs()
or iri in self.project.constrainingFacets
or iri in self.project.getAnnotationPropertyIRIs())):
if self.occursInAtLeastOneSelectedDiagrams(iri):
iriEl = self.getIriDomElement(iri)
irisEl.appendChild(iriEl)
for iri in sorted(self.project.iris, key=str):
iriEl = self.getIriDomElement(iri)
irisEl.appendChild(iriEl)
return ontologyEl

def occursInAtLeastOneSelectedDiagrams(self,iri):
for diagram in self.selectedDiagrams:
if self.project.iriOccurrences(iri=iri,diagram=diagram):
return True
return False

def getOntologyImportDomElement(self, impOnt):
impEl = self.getDomElement('import')
impEl.setAttribute('iri', impOnt.ontologyIRI)
Expand Down

0 comments on commit 5379cc5

Please sign in to comment.