Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix import ontology from salsah-export (DSP-1532) #59

Merged
merged 7 commits into from Apr 20, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion knora/dsplib/models/helpers.py
Expand Up @@ -397,7 +397,6 @@ def reduce_iri(self, iristr: str, ontoname: Optional[str] = None) -> str:
knora_api = self.prefix_from_iri("http://api.knora.org/ontology/knora-api/v2#")
salsah_gui = self.prefix_from_iri("http://api.knora.org/ontology/salsah-gui/v2#")

#if self.__is_iri(iristr):
if IriTest.test(iristr):
iristr = self.get_prefixed_iri(iristr)
tmp = iristr.split(':')
Expand Down
5 changes: 3 additions & 2 deletions knora/dsplib/models/langstring.py
Expand Up @@ -193,15 +193,16 @@ def toJsonObj(self):
if self._simplestring is not None:
return self._simplestring
else:
return list(map(lambda a: {'language': a[0].value, 'value': a[1]}, self._langstrs.items()))
return list(map(lambda a: {'language': a[0].value, 'value': a[1] if a[1] else "-"}, self._langstrs.items()))

def toJsonLdObj(self):
if self.isEmpty():
return None
if self._simplestring is not None:
return self._simplestring
else:
return list(map(lambda a: {'@language': a[0].value, '@value': a[1]}, self._langstrs.items()))
return [{'@language': a[0].value, '@value': a[1]} for a in self._langstrs.items()]
#return list(map(lambda a: {'@language': a[0].value, '@value': a[1]}, self._langstrs.items()))

@classmethod
def fromJsonLdObj(cls, obj: Optional[Union[List[Dict[str, str]], str]]) -> 'LangString':
Expand Down
3 changes: 2 additions & 1 deletion knora/dsplib/models/propertyclass.py
Expand Up @@ -311,7 +311,8 @@ def resolve_propref(resref: str):
tmp = resref.split(':')
if len(tmp) > 1:
if tmp[0]:
return {"@id": resref} # fully qualified name in the form "prefix:name"
# return {"@id": resref} # fully qualified name in the form "prefix:name"
return {"@id": self._context.get_qualified_iri(resref)} # fully qualified name in the form "prefix:name"
else:
return {"@id": self._context.prefix_from_iri(self._ontology_id) + ':' + tmp[1]} # ":name" in current ontology
else:
Expand Down
2 changes: 1 addition & 1 deletion knora/dsplib/utils/knora-schema.json
Expand Up @@ -329,7 +329,7 @@
},
"width": {
"type": "string",
"pattern": "^[0-9]*%$"
"pattern": "^[0-9]*%?$"
},
"wrap": {
"type": "string",
Expand Down
Empty file added knora/mylist.json
Empty file.