-
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
KnarQL Route and Documentation #620
Conversation
…s that pre-process a given search string in order to support Apache Lucene Parser Syntax
…ues for the main resource if the user asks for it
…dent resources if no props are requested for main resource
If a link property has more than one instance and a query variable is used as an object (represening the resource referred to), the row is repeated with he current design (for the same main resource several rows are returned). Consider the following example:
In Knora, there are three link objects that point to incunabula:books. However, the answer returned by Knora looks like this:
Looking at the prequery explains this behaviour:
Proposed solution: Group By main resource and the sorting criteria (otherwise Order By does not work because the order by criterion is not bound), use Group_Concat to aggregate dependent resource Iris:
Result:
|
An incoming query for
Proposed enhancement: We could try to include the value object Iris in the results (also using Group_Concat since there may be several instances). This would make it possible to return exactly those instances of a property in the answer that match the given criteria without having to repeat this logic. Actually the presence of these value object Iris would allow for permission checking too. If the user does not have sufficient permission for all given value object Iris, the whole resource should be suppressed, even though the user might have permissions to see the resource. |
…ing a dependent resource may return more than one Iri, thus GROUP_CONCAT has to be used
…by in transformer
… input query's WHERE clause
…prop from linking prop variable
…query returned results
…by myself in the very close future) restriction of values to value object Iris (returned by the prequery) in CONSTRUCT query
… forbidden resource
…tandoff if necessary
…CONSTRUCT clause of the query
…oes want to be returned (query's Construct clause) - this approach seems very promising to me at the moment and I feel like a great mind. I hope this makes the person feel better that has to debug this code one day, and I cannot exclude that this will be me.
We should also explain what a Knora property is. |
May I ask the reason for supporting schema.org more than any other ontology? Referencing through research engines? And are you not afraid that it will bring (unnecessary?) complexity to the API? |
This is surely a legitimate question. My idea was just that it would be nice to re-use some existing semantics, so we would not have to make up our own response format for a resource request or a query. Of course, we can discuss about whether schema.org makes sense in our case or not. We basically need something to represent a sequence of resources. Later, we are going to need something for values too (including the history of a value). |
done in d6d8a96 |
I see, now. And I can only agree.
What would bother me with schema.org (I don't know it well at all, I must confess) is that it is a very generic ontology and it covers a lot of things. I am not sure of what we would need exactly, but I guess I would be more confortable with ontologies dedicated to data and datasets description, such as DCAT or Void. But I am not sure one of these ontologies would fit all our needs and I am not quite up-to-date on the subject, so I have no better suggestion to make. Besides I am sure you have already delved further into schema.org. |
|
@mrivoal I'm not sure that |
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.
I think this really needs a chapter in docs/design-documentation
, giving an overview of how SearchResponderV2
works.
/** | ||
* An abstract class with utility methods for v2 responders. | ||
*/ | ||
abstract class ResponderV2 extends Responder { |
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.
Please rename ResponderV2
to something more specific, like ResourceTextResponder
, and have only the responders that really need getMappingsFromQueryResultsSeparated
subclass it.
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.
fixed in 0c13561
@@ -1159,15 +1939,12 @@ class SearchResponderV2 extends Responder { | |||
transformer = triplestoreSpecificQueryPatternTransformerSelect | |||
) | |||
|
|||
// _ = println(triplestoreSpecificPrequery.toSparql) | |||
_ = println(triplestoreSpecificPrequery.toSparql) |
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.
Please comment this out, I forgot to do so.
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.
also fixed in 0c13561
@mrivoal We could easily create our own ontology, by only taking the parts we need from
The question is if Google and co are going to actually use this data since according to the Google Structured Data Testing Tool our responses are not valid: |
Thanks @benjamingeer and @subotic for the explanations. I totally understand the point of reusing parts of an ontology that would fit our needs instead of creating a new one.
Sure!
As for this point, I pass :) |
Regarding @subotic : The response in Google Structured Data Testing Tool fails only in those parts where the response does not follow the schema.org specification. As far as I understand, the failing properties will be ignored in search algorithms. If you want to get rid of the red crosses, this could be a possible way (but I don't know if this would still be conform with Knora?): There is also a
Maybe one could use |
@musicEnfanthen Thank you very much for these suggestions, we will have a look. |
@musicEnfanthen Yes, I'm afraid that for Google and Co. to actually use the data, it would need to completely conform to |
There is currently an issue with Travis and pulling of images from Docker Hub: "We’re investigating reports of timeouts in builds while pulling images from Docker Hub." That's why the integration tests on Travis are failing at the moment. |
@subotic I would like to merge this PR. How can I do this (it is blocked). |
@subotic Thanks! |
* develop: fix (webapi): update lucene index on sparql update when using graphdb-free (#633) KnarQL Route and Documentation (#620) feature (extended search V1): support Boolean value in extended search V1 (#643) Make the hostname of project-specific API v2 ontologies configurable (#631) build (travis): deactivate browser tests (#640) test (salsah): add headless browser testing on Travis (#590) Serve an ontology when its IRI is dereferenced (#616) fix (webapi): When requested languages aren't available, take the first one in alphabetical order (#627). (#628) Use cardinalities to get referenced ontologies for XML import schemas. (#617) docs (webapi): add description (#622)
ApacheLuceneSupport
: Utility that pre-processes a search string so that it supports Apache Lucene Parser Syntax. Different use cases: search as you type (search forrdf:label
), fulltext search (use Boolean AND)Attention: this PR may bore you.
TODO:
closes #598
closes #530
relates to #10
relates to #22