sindice api to retrieve *triples* (not by sparql)

47 views
Skip to first unread message

ziqi zhang

unread,
Sep 20, 2012, 5:40:43 AM9/20/12
to sindi...@googlegroups.com
Hi all

I am new to sindice and really excited by the great opportunities it brings. I have just started learning to use it and have got some questions.

As far as i understand, the sindice api (http://sindice.com/developers/searchapiv3) lets me retrieve *documents* (docs containing this triple). And the sparql endpoint lets me to retrieve triples (eg triples containing this word as object). But I wonder if there is an alternative way to retrieve triples by the api? Sparql does appear to be slow sometimes..

thanks!


Szymon Danielczyk

unread,
Sep 20, 2012, 7:25:02 PM9/20/12
to sindi...@googlegroups.com
Hi ziqi zhang

To retrieve triples use sindice cache api v3

http://sindice.com/developers/cacheapi

You can pass an url to the document and you will get back the triples

Cheers
Szymon
> --
> You received this message because you are subscribed to the Google
> Groups "Sindice Developers" group.
> To post to this group, send email to sindi...@googlegroups.com
> To unsubscribe from this group, send email to
> sindice-dev...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/sindice-dev?hl=en
>
> http://sindice.com http://sig.ma http://www.deri.ie

zz

unread,
Sep 21, 2012, 6:18:45 AM9/21/12
to Sindice Developers
Hi Szymon

Thanks. That answered my question partially...
What I meant was that given a query based on the sindice api, return a
list of *triples* matching the query as opposed to documents. for
example:
* <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://
dbpedia.org/ontology/Airline>

gives my a list of documents containing triples satisfying this
pattern. I can understand from your question that I have to go through
each returned document URI, then use the cache api to "filter" just
the triples i wanted.

I understand that this can be done directly by sparql queries, which
will give my directly the triples i wanted. but I guess that would be
much slower?

Thanks


On Sep 21, 12:25 am, Szymon Danielczyk <danielczyk.szy...@gmail.com>
wrote:
> Hi ziqi zhang
>
> To retrieve triples use sindice cache api v3
>
> http://sindice.com/developers/cacheapi
>
> You can pass an url to the document and you will get back the triples
>
> Cheers
> Szymon
>

Szymon Danielczyk

unread,
Sep 21, 2012, 7:05:08 AM9/21/12
to sindi...@googlegroups.com
Hi

On 21 September 2012 11:18, zz <ziqizha...@googlemail.com> wrote:
> Hi Szymon
>
> Thanks. That answered my question partially...
> What I meant was that given a query based on the sindice api, return a
> list of *triples* matching the query as opposed to documents. for
> example:
> * <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://
> dbpedia.org/ontology/Airline>
>
> gives my a list of documents containing triples satisfying this
> pattern. I can understand from your question that I have to go through
> each returned document URI, then use the cache api to "filter" just
> the triples i wanted.
>
> I understand that this can be done directly by sparql queries, which
> will give my directly the triples i wanted. but I guess that would be
> much slower?

Yes at the moment we do not offer an API that could do this
We did a small prototype a while ago which does I think exactly what you want
It takes a sindice search query ( 3 params q,fq,nq + number of
documents like a limit ) and sparql query

It runs the sindice search, then for the results it runs sindice cache
api queries
puts triples in memory an run sparql query over them

So at t end you get only triples you wanted from matching documents

You can try it here [1] but keep in mind - this is not an official API
It is only a demo and it is not meant to be used in any production
ready application
If you need something like this and think that it could be useful for
you and others
we might think of a way to open the source code or improve it and make it
a real sindice api

[1] http://demo.sindice.net/squarql/

Cheers
Szymon

wpawn

unread,
Feb 25, 2013, 9:57:50 AM2/25/13
to sindi...@googlegroups.com
Hi,

I know this is an old thread, but I'd also be very happy to see this functionality in the form of an API, and I'm sure many other users interested in individual Linked Data resources (not entire datasets) would appreciate it. I'd like to stress here that I'm not interested in running complex SPARQL queries, but only in retrieving those triples that match the nq parameter in the search URL. To be more specific, assume I query Sindice via the search API for the following triple:


One of the results retrieved is


What I would like to retrieve is the URIs of all resources matching the above triple. If I try using the cache API to filter the results by field (label), I end up empty handed.

Thanks,
WP

Szymon Danielczyk

unread,
Feb 26, 2013, 7:22:42 PM2/26/13
to sindi...@googlegroups.com
Hi 

If I understood correctly you would like to get URIs of all documents that match the query 
You can use "page"  & "count" params for this, however you will be able to grab only the first 100 pages with max 50 entries each 
So in total 5000 results per query 

...

The same with json 

http://api.sindice.com/v3/search?nq=*%20%3Clabel%3E%20%27Open%27&count=50&format=json&field=link&page=1
http://api.sindice.com/v3/search?nq=*%20%3Clabel%3E%20%27Open%27&count=50&format=json&field=link&page=2
http://api.sindice.com/v3/search?nq=*%20%3Clabel%3E%20%27Open%27&count=50&format=json&field=link&page=3

Cheers
Szymon 








--
--
You received this message because you are subscribed to the Google
Groups "Sindice Developers" group.
To post to this group, send email to sindi...@googlegroups.com
To unsubscribe from this group, send email to
sindice-dev...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/sindice-dev?hl=en
 
http://sindice.com http://sig.ma http://www.deri.ie
 
---
You received this message because you are subscribed to the Google Groups "Sindice Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sindice-dev...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

wpawn

unread,
Feb 27, 2013, 8:28:43 AM2/27/13
to sindi...@googlegroups.com
Hi Szymon,

Actually, no; that's not what I meant. Sorry for the confusion.
What I'm interested in is only the subjects of the triples that match the query, not the entire documents they appear in.

For instance, if I search for

* rdfs:label "Example"

and http://example.org/sample.rdf contains the following triple

 <ex:sampleresource> rdfs:label "Example"

I would like to be able to retrieve only <ex:sampleresource>, not http://example.org/sample.rdf. I think that's also what Ziqi Zhang had in mind.

I hope that makes it clearer.

Thanks,
WP

Szymon Danielczyk

unread,
Feb 27, 2013, 9:32:21 AM2/27/13
to sindi...@googlegroups.com
Hi 

Now I understand 
Sorry it is not possible at the moment 
The only solution would be to use cache api to get the triples and parse them on your side 

All the Best 
Szymon 
Reply all
Reply to author
Forward
0 new messages