-
Notifications
You must be signed in to change notification settings - Fork 18
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
Implement smart IRIs #662
Implement smart IRIs #662
Conversation
…D in ontology classes. - Use SmartIri in constant ontologies, too. - Fix a lot of compile errors (still many left).
- Separate ontology info schema conversion from JSON-LD generation.
# Conflicts: # webapi/src/main/scala/org/knora/webapi/util/KnoraIdUtil.scala # webapi/src/main/scala/org/knora/webapi/util/StringFormatter.scala # webapi/src/test/scala/org/knora/webapi/responders/v2/OntologyResponderV2Spec.scala # webapi/src/test/scala/org/knora/webapi/util/StringFormatterSpec.scala
- Remove IRI caching, because performance is good anyway.
- Put back IRI caching, but only for Knora definition IRIs. - I think OntologyV2R2RSpec test data is wrong (has DatatypeProperty where it should have ObjectProperty).
@tobiasschweizer
Looking at that part of the code in
Could you explain? I'm guessing that you did this because it would have been more work to convert the IRI |
- Cache some known non-Knora definition IRIs.
The reason is that in a KnarQL query the user would use simple Iris like a In |
Yes, it was kind of a hack ;-) |
Maybe my question wasn’t clear. I’m asking why the search responder refers to an entity called
|
Simply because the external Iri (type annotation) is converted to an internal one before looking at it, using a regex. And the regex just replaces a part of the Iri, but does not handle the missing However, this is not really consistent behavior since there are also non Knora types like So I would be happy to change this. |
OK, could you please do it on this branch? Then I think I already changed the KnarQL parser and type inspector so they use |
I will look at it :-) |
- Don't parse new smart IRIs when it's not neceessary to do so.
…SmartIri. - Remove old API v2 plans doc, which has already been implemented and superseded. - Add route for getting ontology metadata per project. - Add R2R tests for getting ontology metadata. - Rename "namedgraph" to "allentities" in ontology routes. - Add KnoraContentV2 trait with toOntologySchema method.
@tobiasschweizer I renamed the |
@benjamingeer Thank you very much for the notification. I will make a new branch in SALSAH that will reflect this change and other changes on this branch that effect the routes or the messages. Actually, we need to do coordinated merges: basically you need to open both pull requests and hit the merge buttons at the same time. I guess we need tentacles for this. |
@tobiasschweizer I started added some API v design docs, including a discussion of |
Ok, I look at it now. Just making myself a cappuccino ... |
Each API response is represented by a class that extends ``KnoraResponseV2``, which | ||
has a method ``toJsonLDDocument`` that specifies the target schema. It is currently | ||
up to each route to determine what the appropriate response schema should be. Some routes | ||
will support only one respnse schema. Others will allow the client to choose, and there will |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
respnse -> response
contains the value's IRI. When a value is created, it is wrapped in a ``CreateValueV2``, which has | ||
the resource IRI and the property IRI, but not the value IRI. | ||
|
||
A ``Read*`` wrapper can be wrapped in anotehr ``Read*`` wrapper; for example, a ``ReadResourceV2`` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
anotehr -> another
I had a look at it and I think that it is very useful! |
I am adding more KnarQL R2R tests now to make sure that the changes on this branch do not have unintended effects. |
haha, found a bug in my code!!!!!!!! |
…y be used for sorting
SmartIri
class to simplify IRI inspection, validation, and conversion.StringFormatter
to clarify which ones inspect (is*
), which ones validate (validate*
), and which ones convert (to*
).SmartIri
for the IRIs of ontologies and ontology entities in API v2 code.SmartIri
for all IRIs in KnarQL.SmartIri
. Instead, add v1 wrappers around v2 ontology info classes. In the wrappers, convert smart IRIs to string IRIs. Use only the wrappers in v1 code.ReadEntityDefinitionsV2
instance. Then convert that instance to JSON-LD.SmartIri
instances representing Knora ontology entities..