Re: Is there a way to automatically distinguish SPARQL endpoint and LDF server?

Hi Maxim,

> - request the RDF-based description,

Yes, request an RDF representation of the resource.

> - check whether it has [ a void:Dataset ; void:uriLookupEndpoint
> "<lookup uri>" ] triples and <lookup uri> ends with
> "{?subject,predicate, object}" string, if yes, then it's TPF server

No, TPF servers are free to use whatever IRI templates they want,
so looking for a specific template will not give you any guarantee.

You should really look for the pattern

   _:dataset void:subset <>;
       hydra:search [
         hydra:mapping [ hydra:property rdf:subject ],
         hydra:mapping [ hydra:property rdf:predicate ],
         hydra:mapping [ hydra:property rdf:object ]
       ].

where "_:dataset" can be any IRI,
and <> is the IRI of the resource you just requested.

In other words, you are asking the response the question:
do you belong to a collection that can be searched by triple pattern?

> - otherwise assume that it's a SPARQL endpoint and send a query and
> hope it'll succeed.

+1 for hope ;-)

Cheers,

Ruben

Received on Monday, 24 August 2015 15:56:51 UTC