Use types from the triplestore in predicate objects in ontologies #767
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The case class
PredicateInfoV2
stores the objects of predicates of ontology entities. Currently,PredicateInfoV2
stores all its objects as strings. When ontology information is converted from one schema to another, objects that are actually IRIs have to be converted. SincePredicateInfoV2
doesn't know the types of its objects, something else has to keep track of that. So there are hard-coded sets of predicates that are known to have IRIs as objects, but this is cumbersome. It also means that to convert an IRI,PredicateInfoV2
needs to convert a string to aSmartIri
and back again.This PR takes advantage of the type information that comes with
SparqlExtendedConstructResponse
to enablePredicateInfoV2
to store store IRIs asSmartIri
objects instead of strings.OntologyLiteralV2
, which is likeLiteralV2
but has just the implementations needed byPredicateInfoV2
. (OntologyLiteralV2
shares some of its implementations withLiteralV2
.)PredicateInfoV2
to useOntologyLiteralV2
.Seq
instead of aSet
for the objects inPredicateInfoV2
, so aSeq[StringLiteralV2]
can be accepted as aSeq[OntologyLiteralV2]
(this doesn't work withSet
, becauseSet
is not covariant in its type parameter).knora-api
(default schema),salsah-gui:guiElement
andsalsah-gui:guiAttribute
were not shown in properties in that ontology.salsah-gui:guiOrder
was not accepted when creating a property via API v2.As a result,
PredicateInfoV2.toOntologySchema
becomes nice and simple:Resolves #738.