Have you tried using the following query?
If you are doing a UNION you don't need to have two OPTIONAL clauses inside it.
That may improve the performance, as the issue may be that the query
is being cut off after a certain amount of computation time and you
are getting partial results based on the physical file layout of the
RDF database and number of RDF statements surrounding each URI.
Also, why are you doing the negation test on the language? I thought
that all abstracts and labels in DBpedia had language tags attached to
them, so it should be okay just to do the english test.
SELECT ?label, ?abstract, ?redirect, COUNT(?wikilink)
WHERE {
{
<http://dbpedia.org/resource/$lod_id> <http://dbpedia.org/
property/abstract> ?abstract .
FILTER ( langMatches( lang(?abstract), 'en') || ! langMatches
(lang(?abstract),'*') ) .
<http://dbpedia.org/resource/$lod_id> <http://www.w3.org/2000/01/
rdf-schema#label> ?label .
FILTER ( langMatches( lang(?label), 'en') || ! langMatches(lang(?
label),'*') ) .
}
UNION
{
?redirect <http://dbpedia.org/property/redirect> <http://
dbpedia.org/resource/$lod_id> .
OPTIONAL { ?wikilink <http://dbpedia.org/property/wikilink> ?
redirect }
}
}
Cheers,
Peter
2010/1/15 David Spacey <[email protected]>:
> Hi,
>
> I'm having difficulty querying dbpedia using the sparql interface on
>
> http://dbpedia-live.openlinksw.com/sparql
>
> I'm requesting the label, abstract and a list of redirects, and
> approx. 20% of the time I'm just getting the redirects. With an
> internal instance, running an older snapshot of dbpedia, I'm seeing
> the same problem for around 1% of queries. In every example I've
> checked, the dbpedia id is still current.
>
> So, here are some examples.
>
> Failing on dbpedia-live only
> Adolf_Hitler
> Chicago
> Dora_Bryan
> Emma_Thompson
> Ferrari
>
> Failing on snapshot only
> Austriamicrosystems
> Valery_Gergiev
> Lady_Rachel_Billington
>
> Failing on both
> G20
> Darcy_Edwards
>
> This is the query I'm using, where '$lod_id' is one of the strings
> listed above.
>
> SELECT ?label, ?abstract, ?redirect, COUNT(?wikilink)
> WHERE {
> {
> <http://dbpedia.org/resource/$lod_id> <http://dbpedia.org/
> property/abstract> ?abstract .
> FILTER ( langMatches( lang(?abstract), 'en') || ! langMatches
> (lang(?abstract),'*') ) .
> <http://dbpedia.org/resource/$lod_id> <http://www.w3.org/2000/01/
> rdf-schema#label> ?label .
> FILTER ( langMatches( lang(?label), 'en') || ! langMatches(lang(?
> label),'*') ) .
> }
> UNION
> {
> OPTIONAL {
> ?redirect <http://dbpedia.org/property/redirect> <http://
> dbpedia.org/resource/$lod_id> .
> OPTIONAL { ?wikilink <http://dbpedia.org/property/wikilink> ?
> redirect }
> }
> }
> }
>
> Can anyone suggest why this might fail for valid entries?
>
> TIA
>
> Dave Spacey
>
>
> http://www.bbc.co.uk/
> This e-mail (and any attachments) is confidential and may contain personal
> views which are not the views of the BBC unless specifically stated.
> If you have received it in error, please delete it from your system.
> Do not use, copy or disclose the information in any way nor act in reliance
> on it and notify the sender immediately.
> Please note that the BBC monitors e-mails sent or received.
> Further communication will signify your consent to this.
>
>
> ------------------------------------------------------------------------------
> Throughout its 18-year history, RSA Conference consistently attracts the
> world's best and brightest in the field, creating opportunities for Conference
> attendees to learn about information security's most important issues through
> interactions with peers, luminaries and emerging and established companies.
> http://p.sf.net/sfu/rsaconf-dev2dev
> _______________________________________________
> Dbpedia-discussion mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/dbpedia-discussion
>
------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
Dbpedia-discussion mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dbpedia-discussion