Skip to content

Commit

Permalink
feat(archi): rpp for archi
Browse files Browse the repository at this point in the history
  • Loading branch information
bindeali committed Dec 31, 2024
1 parent 5d1cec3 commit bb2b70a
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 3 deletions.
25 changes: 24 additions & 1 deletion src/archiToOFN.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import sys
from lxml import etree # type: ignore
from ofnClasses import ClassType, Relationship, Trope, Vocabulary, Term, VocabularyType, getClass, getTrope
from ofnClasses import *
from outputToRDF import convertToRDF
from ofnBindings import *
from outputUtil import testInputString
Expand Down Expand Up @@ -115,6 +115,29 @@
[1]] = termProperties[OFN_DESCRIPTION.lower()][0]
if OFN_DATATYPE.lower() in termProperties and isinstance(term, Trope):
term.datatype = termProperties[OFN_DATATYPE.lower()][0]

# RPP
if OFN_RPP_AIS.lower() in termProperties and isinstance(term, TermClass):
term.source = termProperties[OFN_RPP_AIS.lower()][0]
if OFN_RPP_AGENDA.lower() in termProperties and isinstance(term, TermClass):
term.source = termProperties[OFN_RPP_AGENDA.lower()][0]
if OFN_RPP_TYPE.lower() in termProperties and (isinstance(term, Trope) or isinstance(term, Relationship)):
if termProperties[OFN_RPP_TYPE.lower()][0].strip().lower() == YES.lower():
term.rppType = RPPType.PUBLIC
elif termProperties[OFN_RPP_TYPE.lower()][0].strip().lower() == NO.lower():
term.rppType = RPPType.PRIVATE
else:
warnings.warn("warn")
if OFN_RPP_SHARED.lower() in termProperties and (isinstance(term, Trope) or isinstance(term, Relationship)):
if termProperties[OFN_RPP_SHARED.lower()][0].strip().lower() == YES.lower():
term.sharedInPPDF = True
elif termProperties[OFN_RPP_SHARED.lower()][0].strip().lower() == NO.lower():
term.sharedInPPDF = False
else:
warnings.warn("warn")
if OFN_RPP_PRIVATE_SOURCE.lower() in termProperties and (isinstance(term, Trope) or isinstance(term, Relationship)):
term.source = termProperties[OFN_RPP_PRIVATE_SOURCE.lower()][0]

vocabulary.terms.append(term)

for relationship in relationships:
Expand Down
Empty file removed src/archiToOFNBase.py
Empty file.
9 changes: 7 additions & 2 deletions src/tableToOFN.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from typing import List
import openpyxl # type: ignore
import sys
from ofnClasses import Relationship, Term, TermClass, Trope, Vocabulary, VocabularyType, getClass, getTrope, ClassType
from ofnClasses import *
from outputToRDF import convertToRDF
from ofnBindings import *
import csv
Expand Down Expand Up @@ -244,7 +244,12 @@ def rlSheetToOFN(sheet) -> List[Relationship]:
else:
warnings.warn("warn")
if row[rppTypeIndex]:
term.rppType = row[rppTypeIndex]
if row[rppTypeIndex].strip().lower() == YES.lower():
term.rppType = RPPType.PUBLIC
elif row[rppTypeIndex].strip().lower() == NO.lower():
term.rppType = RPPType.PRIVATE
else:
warnings.warn("warn")
if row[rppPrivateTypeSourceIndex]:
term.rppPrivateTypeSource = row[rppPrivateTypeSourceIndex]
if row[relatedSourceIndex]:
Expand Down

0 comments on commit bb2b70a

Please sign in to comment.