Hi all, 

I noticed two kind of unexpected results when using filters. 
For both, I have examples from dbpedia.org sparql endpoint, but I got the same 
kind of results from a virtuoso 6.1.5 running on my machine. 

The first issue is about language tags that are sometimes missing. 
For instance with the following query, there is no xml:lang="fr" in the XML 
result, nor a "@fr" in the html display. 
However, if the second condition in the filter is uncommented, the tag 
reappears! 

select * 
where{ 
< http://dbpedia.org/resource/Augustus > rdfs:label ?n 
filter ( 
((?n = 'Auguste'@fr) 
#|| (?n = 'Auguste'@fr) 
)) 
} 

The second issue seems to be related to the way datatypes are handled. 
The http://dbpedia.org/data/Berlin.ntriples contains these two triples among 
others: 
<http://dbpedia.org/resource/Berlin> <http://dbpedia.org/ontology/elevation> 
"34.0"^^<http://www.w3.org/2001/XMLSchema#double> 
<http://dbpedia.org/resource/Berlin> <http://dbpedia.org/property/elevation> 
"34"^^<http://www.w3.org/2001/XMLSchema#int> 

With the following query, I actually get these two results, although both 
values are casted to integers 
(the xml output contains the attribute 
datatype="http://www.w3.org/2001/XMLSchema#integer"; for both) . 

When the second condition in the filter is uncommented, only the first results 
is returned. 

select * 
where { 
<http://dbpedia.org/resource/Berlin> ?r ?n 
filter ( 
?n=34 
#|| ?n=""@en 
) 
} 

Regards, 
Julien Cojan 

----- Mail original -----

> De: "Pablo Mendes" <[email protected]>
> À: "Julien Cojan" <[email protected]>
> Cc: [email protected]
> Envoyé: Samedi 2 Juin 2012 19:39:58
> Objet: Re: [Dbpedia-developers] bug

> Hi Julien,
> It does not seem to be a problem with XML only. I also see it in the
> HTML output. Looks like you should report to the VOS mailing list:
> http://sourceforge.net/mailarchive/forum.php?f
> orum_name=virtuoso-users

> The query below also returns @fr

> select *
> where{
> < http://dbpedia.org/resource/Augustus > rdfs:label ?n
> filter (
> ((?n = 'Auguste'@fr)
> || (?n = 'Augustin'@fr))
> )
> }

> And this other fails:

> select *
> where{
> < http://dbpedia.org/resource/Augustus > rdfs:label ?n
> filter (
> (?n = 'Auguste'@fr)
> )
> }

> Cheers,
> Pablo

> On Fri, Jun 1, 2012 at 6:47 PM, Julien Cojan < [email protected]
> > wrote:

> > Hi all,
> 

> > While trying some queries on dbpedia I noticed a strange behavior
> > of
> > the XML output with string litterals.
> 
> > I believe this is a bug of Virtuoso, should I report this on some
> > other mailing list ?
> 

> > For instance on dbpedia.org , with the first request
> 
> > select *
> 
> > where{
> 
> > ?x rdfs:label ?n
> 
> > filter (
> 
> > ((?x = < http://dbpedia.org/resource/Augustus >) && (?n =
> > 'Auguste'@fr))
> 
> > )
> 
> > }
> 
> > there is no lang attribute on the litteral node <binding name="n">
> > <literal> Auguste</literal></binding>
> 

> > Whereas if a second condition is added :
> 
> > select *
> 
> > where{
> 
> > ?x rdfs:label ?n
> 
> > filter (
> 
> > ((?x = < http://dbpedia.org/resource/Augustus >) && (?n =
> > 'Auguste'@fr))
> 
> > || ((?x = <http://dbpedia.org/resource/Augustin> ) && (?n =
> > || 'Augustin'@fr))
> 
> > )
> 
> > }
> 
> > The attribute lang appears : <binding name="n"> <literal
> > xml:lang="fr"> Auguste</literal></binding>
> 

> > Cheers,
> 
> > Julien
> 

> > > De: "Olivier Corby" < [email protected] >
> > 
> 
> > > À: "julien cojan" < [email protected] >
> > 
> 
> > > Envoyé: Mercredi 23 Mai 2012 11:41:06
> > 
> 
> > > Objet: bug
> > 
> 

> > > select *
> > 
> 
> > > where
> > 
> 
> > > {
> > 
> 

> > > service <http://dbpedia.org/sparql> {
> > 
> 
> > > {?x rdfs:label ?n . }
> > 
> 
> > > filter (
> > 
> 
> > > #((?x = <http://dbpedia.org/resource/Augustin> ) && (?n =
> > > 'Augustin'@fr))
> > 
> 
> > > #||
> > 
> 
> > > ((?x = <http://dbpedia.org/resource/Augustus> ) && (?n =
> > > 'Auguste'@fr))
> > 
> 
> > > )
> > 
> 
> > > }
> > 
> 

> > > }
> > 
> 
> > ------------------------------------------------------------------------------
> 
> > Live Security Virtual Conference
> 
> > Exclusive live event will cover all the ways today's security and
> 
> > threat landscape has changed and how IT managers can respond.
> > Discussions
> 
> > will include endpoint security, mobile security and the latest in
> > malware
> 
> > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> 
> > _______________________________________________
> 
> > Dbpedia-developers mailing list
> 
> > [email protected]
> 
> > https://lists.sourceforge.net/lists/listinfo/dbpedia-developers
> 

Reply via email to