Re: [Dbpedia-discussion] Inconsistent Results: Set vs. Subset and Set - Subset

2013-11-13 Thread Joshua TAYLOR
You might be interested in this StackOverflow question in which
someone trying to enumerate properties ran two queries and got two
sets of results, but then ran the intersection of those queries and
didn't get the intersection of those sets.  No definitive answer was
reached;  the best guess was timeouts.

http://stackoverflow.com/q/19512255/1281433

//JT

On Wed, Nov 13, 2013 at 11:31 AM, Florian Haag
florian.h...@vis.uni-stuttgart.de wrote:
 Hello,
 I am trying to retrieve a list of predicates from DBpedia with a SPARQL 
 query. The full set looks fine:

 SELECT DISTINCT ?b
 WHERE {
   ?a ?b ?c.
 }
 LIMIT 50

 On http://dbpedia.org/sparql, this returns 50 URIs (let's call this set A), 
 so there are 50 (or probably more) predicates available.

 Now, I just want a subset of this, namely only predicates whose last part in 
 the URI starts with a letter from A to Z:

 SELECT DISTINCT ?b
 WHERE {
   ?a ?b ?c.
   FILTER(regex(str(?b), [/#][a-z][^/#]*$, i)).
 }
 LIMIT 50

 This returns a surprisingly small set (let's call this set B) consisting of 
 only one URI (http://www.w3.org/1999/02/22-rdf-syntax-ns#type), which had 
 also been in set A. But if that set is so small, the complementary set should 
 contain at least the 49 items from set (A - B):

 SELECT DISTINCT ?b
 WHERE {
   ?a ?b ?c.
   FILTER(regex(str(?b), [/#][^a-z/#][^/#]*$, i)).
 }
 LIMIT 50

 I would expect the result set of this query to contain, for example, 
 http://www.w3.org/2002/07/owl#sameAs, which was contained in set A. Instead, 
 the result set of this last query (set C) is empty.

 Why does DBpedia behave like that; is there anything wrong about my queries 
 or my regular expressions? (When trying this on some other endpoints 
 (http://vocabulary.semantic-web.at/PoolParty/sparql/AustrianSkiTeam , 
 http://spatial.ucd.ie/lod/sparql ), the result seems to be as expected.) Note 
 that DBpedia's SPARQL web-frontend does not report any syntax errors, server 
 errors or timeouts.

 Thanks in advance

 --
 DreamFactory - Open Source REST  JSON Services for HTML5  Native Apps
 OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
 Free app hosting. Or install the open source package on any LAMP server.
 Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
 http://pubads.g.doubleclick.net/gampad/clk?id=63469471iu=/4140/ostg.clktrk
 ___
 Dbpedia-discussion mailing list
 Dbpedia-discussion@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/dbpedia-discussion



-- 
Joshua Taylor, http://www.cs.rpi.edu/~tayloj/

--
DreamFactory - Open Source REST  JSON Services for HTML5  Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471iu=/4140/ostg.clktrk
___
Dbpedia-discussion mailing list
Dbpedia-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dbpedia-discussion


Re: [Dbpedia-discussion] Inconsistent Results: Set vs. Subset and Set - Subset

2013-11-13 Thread Florian Haag
Hmm, all right - is there any sign I could watch out for in the response; 
something like the DBpedia server saying This is your result BUT something 
internally timed out, so this result might be incomplete; handle with care.?

I'm wondering because normally, I wouldn't run the complete query at all. I 
would prefer to run only the queries for the subsets in the first place, for 
the very reason of avoiding any timeouts that are bound to happen when I add an 
ORDER BY ?b clause to the query for the complete list.

Regards


Von: Joshua TAYLOR [joshuaaa...@gmail.com]
Gesendet: Mittwoch, 13. November 2013 19:11
An: Florian Haag
Cc: dbpedia-discussion@lists.sourceforge.net
Betreff: Re: [Dbpedia-discussion] Inconsistent Results: Set vs. Subset and Set 
- Subset

You might be interested in this StackOverflow question in which
someone trying to enumerate properties ran two queries and got two
sets of results, but then ran the intersection of those queries and
didn't get the intersection of those sets.  No definitive answer was
reached;  the best guess was timeouts.

http://stackoverflow.com/q/19512255/1281433

//JT

On Wed, Nov 13, 2013 at 11:31 AM, Florian Haag
florian.h...@vis.uni-stuttgart.de wrote:
 Hello,
 I am trying to retrieve a list of predicates from DBpedia with a SPARQL 
 query. The full set looks fine:

 SELECT DISTINCT ?b
 WHERE {
   ?a ?b ?c.
 }
 LIMIT 50

 On http://dbpedia.org/sparql, this returns 50 URIs (let's call this set A), 
 so there are 50 (or probably more) predicates available.

 Now, I just want a subset of this, namely only predicates whose last part in 
 the URI starts with a letter from A to Z:

 SELECT DISTINCT ?b
 WHERE {
   ?a ?b ?c.
   FILTER(regex(str(?b), [/#][a-z][^/#]*$, i)).
 }
 LIMIT 50

 This returns a surprisingly small set (let's call this set B) consisting of 
 only one URI (http://www.w3.org/1999/02/22-rdf-syntax-ns#type), which had 
 also been in set A. But if that set is so small, the complementary set should 
 contain at least the 49 items from set (A - B):

 SELECT DISTINCT ?b
 WHERE {
   ?a ?b ?c.
   FILTER(regex(str(?b), [/#][^a-z/#][^/#]*$, i)).
 }
 LIMIT 50

 I would expect the result set of this query to contain, for example, 
 http://www.w3.org/2002/07/owl#sameAs, which was contained in set A. Instead, 
 the result set of this last query (set C) is empty.

 Why does DBpedia behave like that; is there anything wrong about my queries 
 or my regular expressions? (When trying this on some other endpoints 
 (http://vocabulary.semantic-web.at/PoolParty/sparql/AustrianSkiTeam , 
 http://spatial.ucd.ie/lod/sparql ), the result seems to be as expected.) Note 
 that DBpedia's SPARQL web-frontend does not report any syntax errors, server 
 errors or timeouts.

 Thanks in advance

 --
 DreamFactory - Open Source REST  JSON Services for HTML5  Native Apps
 OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
 Free app hosting. Or install the open source package on any LAMP server.
 Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
 http://pubads.g.doubleclick.net/gampad/clk?id=63469471iu=/4140/ostg.clktrk
 ___
 Dbpedia-discussion mailing list
 Dbpedia-discussion@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/dbpedia-discussion



--
Joshua Taylor, http://www.cs.rpi.edu/~tayloj/

--
DreamFactory - Open Source REST  JSON Services for HTML5  Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471iu=/4140/ostg.clktrk
___
Dbpedia-discussion mailing list
Dbpedia-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dbpedia-discussion