Re: [Dbpedia-discussion] SNORQL and SPARQL endpoints returning different results

2015-02-19 Thread Joshua TAYLOR
In the interest of avoiding any repeated effort, note that this was
also asked on Stack Overflow as:
http://stackoverflow.com/q/28611127/1281433

On Thu, Feb 19, 2015 at 11:44 AM, Chris Wood c.c.w...@gmail.com wrote:
 In the DBpedia SPARQL endpoint [1], running

 PREFIX dc: http://purl.org/dc/elements/1.1/
 PREFIX : http://dbpedia.org/resource/
 PREFIX dbpedia2: http://dbpedia.org/property/

 SELECT ?a (3+3 AS ?y)
 WHERE
 {
?a dc:description English footballer .
?a dbpedia2:placeOfBirth :Merseyside .
 }

 Shows all English Footballers who were born in Merseyside, with column y
 just displaying the value 6 on every row [result link]; however, the same
 query on the SNORQL endpoint displays an error:

 Virtuoso 37000 Error SP030: SPARQL compiler, line 16: syntax error at '3'
 before 'AS' SPARQL query: define sql:big-data-const 0 #output-
 format:application/sparql-results+json define input:default-graph-uri PREFIX
 owl: PREFIX xsd: PREFIX rdfs: PREFIX rdf: PREFIX foaf: PREFIX dc: PREFIX :
 PREFIX dbpedia2: PREFIX dbpedia: PREFIX skos: PREFIX pos: PREFIX dbo: SELECT
 ?a (3 3 AS ?y) WHERE { ?a dc:description English footballer . ?a
 dbpedia2:placeOfBirth :Merseyside . }

 Even more strangely, using any of the other 3 arithmetic operators does work
 in the SNORQL endpoint (e.g. with division [5])

 A previous question [6] on Stackoverflow has implied that the SPARQL and
 SNORQL endpoints should return the same result, so what's going on here?!

 Cheers,
 Chris

 1: http://dbpedia.org/sparql/
 2:
 http://dbpedia.org/sparql/?default-graph-uri=http%3A%2F%2Fdbpedia.orgquery=PREFIX+dc%3A+%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Felements%2F1.1%2F%3E%0D%0APREFIX+%3A+%3Chttp%3A%2F%2Fdbpedia.org%2Fresource%2F%3E%0D%0APREFIX+dbpedia2%3A+%3Chttp%3A%2F%2Fdbpedia.org%2Fproperty%2F%3E%0D%0A%0D%0ASELECT+%3Fa+%283%2B3+AS+%3Fy%29%0D%0AWHERE+%0D%0A%7B+%0D%0A+++%3Fa+dc%3Adescription+%22English+footballer%22+.%0D%0A+++%3Fa+dbpedia2%3AplaceOfBirth+%3AMerseyside+.%0D%0A%7Dformat=text%2Fhtmltimeout=3debug=on
 3:
 http://dbpedia.org/snorql/?query=PREFIX+pos%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F2003%2F01%2Fgeo%2Fwgs84_pos%23%3E%0D%0APREFIX+dbo%3A+%3Chttp%3A%2F%2Fdbpedia.org%2Fontology%2F%3E%0D%0A%0D%0ASELECT+%3Fa+%283%2B3+AS+%3Fy%29%0D%0AWHERE+%0D%0A%7B+%0D%0A+%3Fa+dc%3Adescription+%22English+footballer%22+.%0D%0A+%3Fa+dbpedia2%3AplaceOfBirth+%3AMerseyside+.%0D%0A%7D
 4: http://dbpedia.org/snorql/
 5:
 http://dbpedia.org/snorql/?query=PREFIX+pos%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F2003%2F01%2Fgeo%2Fwgs84_pos%23%3E%0D%0APREFIX+dbo%3A+%3Chttp%3A%2F%2Fdbpedia.org%2Fontology%2F%3E%0D%0A%0D%0ASELECT+%3Fa+%283%2F3+AS+%3Fy%29%0D%0AWHERE+%0D%0A%7B+%0D%0A+%3Fa+dc%3Adescription+%22English+footballer%22+.%0D%0A+%3Fa+dbpedia2%3AplaceOfBirth+%3AMerseyside+.%0D%0A%7D
 6: http://stackoverflow.com/a/15658884/889604


 --
 Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
 from Actuate! Instantly Supercharge Your Business Reports and Dashboards
 with Interactivity, Sharing, Native Excel Exports, App Integration  more
 Get technology previously reserved for billion-dollar corporations, FREE
 http://pubads.g.doubleclick.net/gampad/clk?id=190641631iu=/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/

--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration  more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631iu=/4140/ostg.clktrk
___
Dbpedia-discussion mailing list
Dbpedia-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dbpedia-discussion


Re: [Dbpedia-discussion] Why are sparql results incomplete?

2014-11-17 Thread Joshua TAYLOR
On Mon, Nov 17, 2014 at 4:14 AM, Daniel Fleischhacker
dan...@informatik.uni-mannheim.de wrote:
 at least for your example this is caused by a redirect from
 Maximilien_Robespierre to Maximilien_de_Robespierre.

There are some answers on Stack Overflow (disclaimer, I know them
because I wrote some of them :)) that address how to work with
redirected resources in SPARQL:

* [Retrieving properties of redirected
resource](http://stackoverflow.com/q/19380175/1281433)
* [Obtain linked resources with SPARQL query on
DBpedia](http://stackoverflow.com/q/25502009/1281433)
* [Retrieving dbpedia-owl:type value of resource with
dbpedia-owl:wikiPageRedirect
value?](http://stackoverflow.com/q/23871225/1281433)

The most common theme is querying with something like

select ?p ?v {
  dbpedia:Foo dbpedia-owl:wikiPageRedirects* ?foo .
  ?foo ?p ?v
}

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

--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration  more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751iu=/4140/ostg.clktrk
___
Dbpedia-discussion mailing list
Dbpedia-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dbpedia-discussion


Re: [Dbpedia-discussion] The trouble with DBpedia

2014-07-14 Thread Joshua TAYLOR
The WikiData project is great, but this article seems to be saying
the raw infobox data is dirty, oh no! and ignoring the consistent
Infobox ontology that's already taken care of lots of the problems
that it [the article] mentions.  E.g., the query

select ?c COUNT(*) AS ?cnt {
   ?s dbpprop:country ?c .
}
GROUP BY(?c)
ORDER BY DESC(?cnt)
LIMIT 30

does highlight the dirtiness in the raw data [1].  However, using the
corresponding infobox ontology property, dbpedia-owl:country, we get
much cleaner results:

select ?c (count(*) as ?cnt) {
  ?s dbpedia-owl:country ?c .
}
GROUP BY(?c)
ORDER BY DESC(?cnt)
LIMIT 30

This returns only OWL individuals, and they all have type country.
This means that you don't need to, as the article suggests, rewrite
the query as:

select ?s {
   ?s dbpprop:country ?c .
  FILTER(?c IN (:United_States,United States@en,USA@en,...)
}

because the other alternative mentioned, i.e.:


One strategy is to apply a cleaning process to a database before we
run queries. We clean up the data first, load it into a database, and
then do queries. We'd deal with the multiple names by rewriting
United States@en and all the other variants to :United_States.


has already been done in the infobox ontology. I think that WikiData's
a great project and may very well be the right way to do it right
from the beginning.  That said, it seems a bit disingenuous to ignore
the higher quality data that's already available in DBpedia in the
infobox ontology.

//JT

[1]  As an aside, it's also not a legal SPARQL query, although the
endpoint accepts it.  It should be select ?c (COUNT(*) as ?cnt) { …
with parentheses around the count as.  You can validate it with
sparql.org's query validator.

On Mon, Jul 14, 2014 at 6:49 PM, Paul Houle ontolo...@gmail.com wrote:
 http://blog.databaseanimals.com/the-trouble-with-dbpedia

 --
 Paul Houle
 Expert on Freebase, DBpedia, Hadoop and RDF
 (607) 539 6254paul.houle on Skype   ontolo...@gmail.com
 ᐧ

 --
 Want fast and easy access to all the code in your enterprise? Index and
 search up to 200,000 lines of code with a free copy of Black Duck
 Code Sight - the same software that powers the world's largest code
 search on Ohloh, the Black Duck Open Hub! Try it now.
 http://p.sf.net/sfu/bds
 ___
 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/

--
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
___
Dbpedia-discussion mailing list
Dbpedia-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dbpedia-discussion


Re: [Dbpedia-discussion] Extract specific properties of a resource

2014-06-06 Thread Joshua TAYLOR
On Fri, Jun 6, 2014 at 8:38 AM, Mohammad Ghufran emghuf...@gmail.com
wrote:

 ​However, i get different results on DBPedia sparql endpoint and my own
 local endpoint (which i created by importing all the English language
 DBPedia files into Virtuoso open source). I get the country using
 dbpedia-owl:country from DBPedia but i don't get anything for it on my
 local install. I am clueless about what could be the reason for it.


Well, without telling us how you imported the data, and how you're
querying, we're just as clueless as you, I'm afraid. :)  Be sure to check
that the data was loaded properly, and that you've got the right namespace
declarations (e.g., dbpedia-owl: is http://dbpedia.org/ontology/, etc.).

//JT


-- 
Joshua Taylor, http://www.cs.rpi.edu/~tayloj/
--
Learn Graph Databases - Download FREE O'Reilly Book
Graph Databases is the definitive new guide to graph databases and their 
applications. Written by three acclaimed leaders in the field, 
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech___
Dbpedia-discussion mailing list
Dbpedia-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dbpedia-discussion


Re: [Dbpedia-discussion] Bug - Filter and Bind against Virtuoso dbpedia sparql endpoint returns no results

2014-01-27 Thread Joshua TAYLOR
It's worth noting, this was mentioned and discussed on answers.semanticweb.com:
http://answers.semanticweb.com/questions/26186/filter-and-bind-against-virtuoso-dbpedia-sparql-endpoint-returns-no-results

On Tue, Jan 28, 2014 at 12:09 AM, Glenn Kruszewski
glennkruszew...@hotmail.com wrote:
 Running the following query against the dbpedia virtuoso SPARQL endpoint
 (http://dbpedia.org/sparql) returns no results. Removing the bind will
 return the results correctly. This seems to be a bug.

 PREFIX dbpedia2: http://dbpedia.org/property/



 SELECT *

 WHERE

 {

   ?city dbpedia2:name ?name .

   FILTER (?name = Luanda@en) .

   BIND (IF(1  2, true, false) AS ?test) .

 }




 --
 WatchGuard Dimension instantly turns raw network data into actionable
 security intelligence. It gives you real-time visual feedback on key
 security issues and trends.  Skip the complicated setup - simply import
 a virtual appliance and go from zero to informed in seconds.
 http://pubads.g.doubleclick.net/gampad/clk?id=123612991iu=/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/

--
WatchGuard Dimension instantly turns raw network data into actionable 
security intelligence. It gives you real-time visual feedback on key
security issues and trends.  Skip the complicated setup - simply import
a virtual appliance and go from zero to informed in seconds.
http://pubads.g.doubleclick.net/gampad/clk?id=123612991iu=/4140/ostg.clktrk
___
Dbpedia-discussion mailing list
Dbpedia-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dbpedia-discussion


Re: [Dbpedia-discussion] Constructing the right SPARQL query

2013-12-21 Thread Joshua TAYLOR
On Sat, Dec 21, 2013 at 1:04 PM, Ali Gajani aligaj...@gmail.com wrote:

 SELECT *
 WHERE {
 ?p a
 http://dbpedia.org/ontology/Person .
 { ?p http://dbpedia.org/ontology/influenced ?influenced. }
 UNION
 { ?p http://dbpedia.org/ontology/influencedBy ?influencedBy.}
 }


With a query like this, I'd expect that both properties would be used to
find a match for ?influencer and ?influenced.  E.g.,

select distinct ?influencer ?influencee where {
  { ?influencer dbpedia-owl:influenced ?influencee }
  UNION
  { ?influencee dbpedia-owl:influencedBy ?influencer }
}
limit 50

Of course, this can be done even more simply with property paths:

select distinct ?influencer ?influencee where {
  ?influencer dbpedia-owl:influenced|^dbpedia-owl:influencedBy ?influencee
}
limit 50

//JT


-- 
Joshua Taylor, http://www.cs.rpi.edu/~tayloj/
--
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET,  PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831iu=/4140/ostg.clktrk___
Dbpedia-discussion mailing list
Dbpedia-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dbpedia-discussion


Re: [Dbpedia-discussion] Constructing the right SPARQL query

2013-12-21 Thread Joshua TAYLOR
On Sat, Dec 21, 2013 at 2:24 PM, Ali Gajani aligaj...@gmail.com wrote:

 Firstly, thank you so much for helping me discover new knowledge (for
 myself) through this beautifully crafted SPARQL. This makes a lot more
 sense that you have used the DISTINCT keyword to actually eliminate any
 duplicates, but will this query ensure the truth is captured in one table
 in the same way as the individual two tables did, because I want to make
 sure I can use this dataset to count indegrees (high influencers) properly.
 It is impossible to survey all the rows to ensure the knowledge is true,
 but I am asking anyway.


If that's what you're trying to measure, then you could use a query like

select ?influencer (count(distinct ?influencee) as ?numberOfInfluencees)
where {
  ?influencer dbpedia-owl:influenced|^dbpedia-owl:influencedBy ?influencee
}
group by ?influencer
order by desc(?numberOfInfluencees)
limit 100

to find out how many distinct influencees each influencer had.  (Karl Marx
is pretty influential.)



-- 
Joshua Taylor, http://www.cs.rpi.edu/~tayloj/
--
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET,  PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831iu=/4140/ostg.clktrk___
Dbpedia-discussion mailing list
Dbpedia-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dbpedia-discussion


Re: [Dbpedia-discussion] Constructing the right SPARQL query

2013-12-21 Thread Joshua TAYLOR
On Sat, Dec 21, 2013 at 2:38 PM, Ali Gajani aligaj...@gmail.com wrote:

 Thanks, I get this table is pretty cool (and yeah, I thought Aristotle
 would be first but I was wrong) but I'd like to keep my table in this form: 
 *Influencee
 : Influencer *so I can actually plot it in Gephi and then do the rest. I
 think the earlier query you mentioned does that, however, my question was,
 does it capture the truth as the two earlier individual tables did
 individually? I just wanted to be sure it does. Moreover, my it would be
 nice to modify the query to include persons as I did in my Question
 originally, because at this stage, it gives you stuff like Java
 Programming Language, which is funny as I'd not like it to be there,
 specially for my analysis of the 'most powerful men in history'. Thanks
 Josh.


Yes, you're getting the same results as you would from two separate
queries, or from the query using the union (modulo the removal of any
duplicate results using `distinct`).   You can make sure that the
influencer and influencee are both people by using the same thing you had
before: checking for a ?i rdf:type dbpedia-owl:Person triple:

select * where {
  ?influencer dbpedia-owl:influenced ?influencee .
  dbpedia-owl:Person ^a ?influencer, ?influencee .
}


-- 
Joshua Taylor, http://www.cs.rpi.edu/~tayloj/
--
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET,  PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831iu=/4140/ostg.clktrk___
Dbpedia-discussion mailing list
Dbpedia-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dbpedia-discussion


Re: [Dbpedia-discussion] How can I help?

2013-12-07 Thread Joshua TAYLOR
On Sat, Dec 7, 2013 at 6:52 PM, Timothy Lebo le...@rpi.edu wrote:
 The following query for the number of universities in each country is a bit 
 “ugly”. For example,

 1) Countries are identified with URIs or Strings, and the same country is 
 identified in many different ways.
 2) The country “20” has three universities :-)

 I’m not very familiar with the workflow that DBPedia has, but I’m curious 
 what I could do to fix the results as “upstream” as possible.
 Is there a “how to help” page somewhere that I could read?
 Or, could someone provide me a few pointers to get started?

 Thanks for your consideration.

 Regards,
 Tim Lebo


 http://dbpedia.org/sparql

 {{{
 prefix dbpedia: http://dbpedia.org/resource/
 prefix dbo: http://dbpedia.org/ontology/
 prefix dbp: http://dbpedia.org/property/

 select ?country count(distinct ?university) as ?count
 where {
?university dbo:type dbpedia:Public_university
   optional{?university dbp:country ?country}
 }
 group by ?country
 order by desc(?count)
 }}}

In your query, you're using the raw infobox data.  That data is much
more noisy than the data in the DBpedia Ontology.  If you restrict
yourself to the DBpedia ontology, you'll get much more sensible
results.  E.g., if you execute this query on the DBpedia SPARQL
endpoint (http://dbpedia.org/sparql) (which includes the prefix
dbpedia-owl: http://dbpedia.org/ontology/):

  select ?country (count(?university) as ?count)
  where {
?university a dbpedia-owl:University
optional{ ?university dbpedia-owl:country ?country}
  }
  group by ?country

you get much better results.  For more about the differences, see this
StackOverflow question (http://stackoverflow.com/q/17237144/1281433),
and some of the DBpedia documentation that the answer links to.  Happy
SPARQLing!

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

--
Sponsored by Intel(R) XDK 
Develop, test and display web and hybrid apps with a single code base.
Download it for free now!
http://pubads.g.doubleclick.net/gampad/clk?id=111408631iu=/4140/ostg.clktrk
___
Dbpedia-discussion mailing list
Dbpedia-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dbpedia-discussion


Re: [Dbpedia-discussion] How can I help?

2013-12-07 Thread Joshua TAYLOR
On Sat, Dec 7, 2013 at 11:52 PM, Joshua TAYLOR joshuaaa...@gmail.com wrote:
  For more about the differences, see this
 StackOverflow question (http://stackoverflow.com/q/17237144/1281433),
 and some of the DBpedia documentation that the answer links to.  Happy
 SPARQLing!

This is a common enough issue that I've described it a number of times
on StackOverflow. Here are two other cases where the noise in the raw
infobox data affected people's results:

http://stackoverflow.com/q/16977418/1281433
http://stackoverflow.com/q/18834426/1281433


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

--
Sponsored by Intel(R) XDK 
Develop, test and display web and hybrid apps with a single code base.
Download it for free now!
http://pubads.g.doubleclick.net/gampad/clk?id=111408631iu=/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 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] Dereferencing URIs using Jena.

2013-11-08 Thread Joshua TAYLOR
On Fri, Nov 8, 2013 at 7:50 AM, Luciane Monteiro luciane@gmail.com wrote:
 Model model = ModelFactory.createDefaultModel();
 model.read( http://dbpedia.org/resource/Google; );

I doubt a Jena question really belongs on the DBpedia mailing list.
This question doesn't essentially depend on DBpedia at all;  it's just
about retrieving some data using Jena and then querying a Jena model.
It would be more appropriate to ask on the Jena users mailing list.

At any rate, Once you have the model, and since you know that the
resource is http://dbpedia.org/resource/Google, you'd do something
like this (untested):

Resource google = model.createResource( http://dbpedia.org/resource/Google; );
StmtIterator stmts = google.listProperties( RDFS.comment );
while ( stmts.hasNext() ) {
  Statement stmt = stmts.next();
  RDFNode comment = stmt.getObject();
  /* do something with the comment */
}

//JT

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

--
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most 
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231iu=/4140/ostg.clktrk
___
Dbpedia-discussion mailing list
Dbpedia-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dbpedia-discussion