mmisw / orr-portal

ORR Frontend component
Apache License 2.0
8 stars 5 forks source link

term search problem #112

Closed jpersons closed 7 years ago

jpersons commented 7 years ago

Hi, Having a problem searching for terms. As outlined in the enclosed, a search for term "sensor" works at http://cor.esipfed.org. But when working at http://cor.esipfed.org/ontapi/ I get no result (tried noparm search 1st to see if I was in the ballpark, and that brings back a list of the ontologies).

When using turi under /ont to search "sensor" I get a blank response.

Must be missing something.

Jerry ESIP_cor.pdf

carueda commented 7 years ago

Hi Jerry,

First off, thanks much for testing the ORR software (and for the great issue report!).

The 'turi' parameter is for resolution of a term by its URI [1], not for searching. When you enter 'sensor' as URI, the system performs a query for all triples having the URI 'sensor' as its subject. Since there's no such subject at all in the triple store, then you get the blank response:

{
  "names": [
    "property",
    "value"
  ],
  "values": []
}

Now, the "search" function you exercised in the main page relies on a SPARQL query performed behind scenes by the ORR portal:

image

You can see the query itself by hovering your mouse over the 'SPARQL' label next to the input field:

select distinct ?subject ?predicate ?object
where {
 ?subject ?predicate ?object.
 filter (regex(str(?subject), "sensor[^/#]*$", "i")
   || regex(str(?object), "sensor", "i"))
}
order by ?subject

You can also programmatically perform a similar search, but in this case you will make your request against the SPARQL endpoint (and not to the general ORR endpoint). Although details are still rather limited regarding SPARQL requests in the ORR documentation, the SPARQL API interface is standard. We currently use AllegroGraph as the underlying triple store and the corresponding SPARQL documentation is at https://franz.com/agraph/support/documentation/current/http-protocol.html.

Being aware that the SPARQL mechanism can be not as user-friendly in some scenarios, we are planning on adding some "shortcuts" through the main ORR API interface for typical operations like the "term search" visible in the portal. This is not implemented yet but I just captured an entry for this (https://github.com/mmisw/orr-ont/issues/50). We welcome your continued feedback!

Carlos


[1] IRI as of ORR v3.6.0

jpersons commented 7 years ago

Carlos,

Thanks much for the feedback ... makes sense, I failed to pick up on the web interface being a SPARQL query.

Jerry

carueda commented 7 years ago

Jerry:

I have advanced an implementation of a simplified interface for basic semantic queries through the main ORR endpoint, please see https://github.com/mmisw/orr-ont/issues/50. At this moment this is only available on the MMI ORR instance. I hope to be updating the COR and XDOMES instances in a few days. If you have any comments/suggestions regarding this new backend functionality, please let me know (you can also use the orr-ont issue tracker). Thanks!

Carlos