|
onto = get_ontology("file://../Ontology/ontoUseCase.owl").load()
def createUCModel(projOwner, projectName):
with onto:
projectOwner=User.objects.get(username=projOwner)
proj=projectOwner.project_set.get(projectName=projectName)
usecases=proj.usecaseprofile_set.all()
for useC in usecases:
#create use case instances along with data and object properties
my_UseCase = onto.UseCase(useC.useCasename)
my_UseCase.hasBoundary=[useC.useCaseBoundary]
my_UseCase.hasPurpose=[useC.useCasePurpose]
my_UseCase.hasInteraction=[useC.useCaseInteraction]
my_UseCase.name=[useC.useCasename]
#calling the method
createUCModel("willi", "Marvel E-Store")
onto.save()
|