You can subscribe to this list here.
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2010 |
Jan
|
Feb
|
Mar
(1) |
Apr
(3) |
May
(2) |
Jun
(2) |
Jul
|
Aug
(2) |
Sep
(1) |
Oct
|
Nov
(9) |
Dec
(4) |
2011 |
Jan
(1) |
Feb
(6) |
Mar
(9) |
Apr
(9) |
May
(20) |
Jun
(1) |
Jul
(2) |
Aug
(1) |
Sep
(6) |
Oct
(3) |
Nov
(13) |
Dec
(1) |
2012 |
Jan
(1) |
Feb
(12) |
Mar
(5) |
Apr
(8) |
May
|
Jun
(25) |
Jul
(7) |
Aug
(4) |
Sep
(14) |
Oct
(5) |
Nov
(22) |
Dec
(6) |
2013 |
Jan
(18) |
Feb
(28) |
Mar
(11) |
Apr
(18) |
May
(4) |
Jun
|
Jul
(9) |
Aug
(6) |
Sep
(4) |
Oct
(4) |
Nov
(6) |
Dec
(7) |
2014 |
Jan
(9) |
Feb
(15) |
Mar
(14) |
Apr
(7) |
May
(5) |
Jun
(15) |
Jul
(2) |
Aug
(6) |
Sep
(5) |
Oct
(7) |
Nov
(9) |
Dec
(16) |
2015 |
Jan
(4) |
Feb
(5) |
Mar
(1) |
Apr
(2) |
May
(2) |
Jun
(15) |
Jul
(8) |
Aug
|
Sep
(4) |
Oct
|
Nov
(4) |
Dec
(4) |
2016 |
Jan
(1) |
Feb
(1) |
Mar
|
Apr
|
May
(5) |
Jun
(5) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Anton H. <Ant...@ee...> - 2010-11-16 11:47:26
|
Hi Rob Thanks for the reply - that is really helpful. I like the idea of using a query, and can really see the benefit in it. I have tried the following, but I'm not getting any results back. Is that I am querying a graph?: private static void ExecuteQuery(Graph g) { string myquery = "PREFIX dc: <http://purl.org/dc/elements/1.1/> PREFIX image: <http://www.eea.europa.eu/portal_types/Image#> SELECT ?image ?description WHERE { ?image a image:Image ; dc:description ?description }"; SparqlQueryParser sparqlparser = new SparqlQueryParser(); SparqlQuery query = sparqlparser.ParseFromString(myquery); Object results = g.ExecuteQuery(query); if (results is VDS.RDF.Query.SparqlResultSet) { SparqlResultSet rset = (SparqlResultSet)results; foreach (SparqlResult result in rset) { Console.WriteLine(result.ToString()); } } } Many thanks for your assistance. Regards, Anton ________________________________ From: Rob Vesse [mailto:rv...@do...] Sent: 15. november 2010 18:20 To: dotNetRDF User Help and Support Cc: Anton Hughes Subject: re: [Dotnetrdf-support] Help retrieving value from RDF file Hi Anton Once you have retrieved the value of the Image URL (I assume you are enumerating over ts to get the value) you can use the INode that you retrieved to then make another query e.g. //Assuming you have the INode representing the image URI in a variable called url UriNode description = g.CreateUriNode("dc:description"); ts = g.GetTriplesWithSubjectPredicate(url, description); foreach (Triple t in ts) { //Do something with t.Object which will be an INode containing the description //Probably easiest to cast to literal and use the value property e.g. //((LiteralNode)t.Object).Value } Generally speaking if you want to retrieve multiple values from a Graph like this it'll usually be easier to write an appropriate SPARQL query e..g. PREFIX dc: <http://purl.org/dc/elements/1.1/> PREFIX image: <http://www.eea.europa.eu/portal_types/Image#> SELECT ?image ?description WHERE { ?image a image:Image ; dc:description ?description . } You can execute this on a Graph by using the ExecuteQuery() extension method. You'll get back a SparqlResultSet (typed as Object so you'll need to cast it explicitly to SparqlResultSet) which you can then enumerate through and get the URL and Description of each Image in the Graph. Advantage of the SPARQL method is that adding additional values to retrieve is very easy as you only have to modify your SPARQL query. Let me know if you need any more help on this. Best Regards, Rob Vesse ________________________________ From: "Anton Hughes" <Ant...@ee...> Sent: 15 November 2010 16:55 To: "dot...@li..." <dot...@li...> Subject: [Dotnetrdf-support] Help retrieving value from RDF file Hi all Im currently using dotnetRDF on a project, and its working well in most cases. However Im stuck with trying to retrieve some values. the c# code I'm using is to get the image url is: //Get all Triples which meet some criteria //Want to find everything that is rdf:type ex:Person UriNode rdfType = g.CreateUriNode("rdf:type"); //UriNode person = g.CreateUriNode("image:Image"); //folder:Folder UriNode person = g.CreateUriNode("image:Image"); ts = g.GetTriplesWithPredicateObject(rdfType, person); if somone could help me I would be very appreciative. Here is a sample of the rdf doc that I am using. I can retrieve the value for the image URL, but I need to get the value for the 'description'. <?xml version="1.0" encoding="utf-8"?> <rdf:RDF xmlns:dcterms='http://purl.org/dc/terms/' xmlns:folder='http://www.eea.europa.eu/portal_types/Folder#' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:dc='http://purl.org/dc/elements/1.1/' xmlns:image='http://www.eea.europa.eu/portal_types/Image#' > <image:Image rdf:about="http://www.eea.europa.eu/atlas/eea/a-day-in-my-forest/satellite-images/satellite-images/poland-forest"> <dc:created xml:lang="en">2010/10/12 15:10:57.842 GMT+2</dc:created> <dc:creator>deliggia</dc:creator> <dc:effective xml:lang="en">2010/09/29 17:11:35 GMT+2</dc:effective> <dcterms:isPartOf> <folder:Folder rdf:about="http://www.eea.europa.eu/atlas/eea/a-day-in-my-forest/satellite-images/satellite-images"> <folder:id xml:lang="en">satellite-images</folder:id> <dc:created xml:lang="en">2010/09/29 17:03:59.451 GMT+2</dc:created> <dc:creator>deliggia</dc:creator> <dc:effective xml:lang="en">2010/09/29 17:11:35 GMT+2</dc:effective> <dcterms:isPartOf rdf:resource="http://www.eea.europa.eu/atlas/eea/a-day-in-my-forest/satellite-images"/<http://www.eea.europa.eu/atlas/eea/a-day-in-my-forest/satellite-images%22/>> <dc:modified xml:lang="en">2010/09/29 17:54:54.189 GMT+2</dc:modified> <dcterms:hasPart rdf:resource="http://www.eea.europa.eu/atlas/eea/a-day-in-my-forest/satellite-images/satellite-images/poland-forest"/<http://www.eea.europa.eu/atlas/eea/a-day-in-my-forest/satellite-images/satellite-images/poland-forest%22/>> <dcterms:hasPart rdf:resource="http://www.eea.europa.eu/atlas/eea/a-day-in-my-forest/satellite-images/satellite-images/forest-legend"/<http://www.eea.europa.eu/atlas/eea/a-day-in-my-forest/satellite-images/satellite-images/forest-legend%22/>> <dcterms:hasPart rdf:resource="http://www.eea.europa.eu/atlas/eea/a-day-in-my-forest/satellite-images/satellite-images/bialowieza-primaeval-forest-poland-2"/<http://www.eea.europa.eu/atlas/eea/a-day-in-my-forest/satellite-images/satellite-images/bialowieza-primaeval-forest-poland-2%22/>> <dcterms:hasPart rdf:resource="http://www.eea.europa.eu/atlas/eea/a-day-in-my-forest/satellite-images/satellite-images/satellite-images-1"/<http://www.eea.europa.eu/atlas/eea/a-day-in-my-forest/satellite-images/satellite-images/satellite-images-1%22/>> <dcterms:hasPart rdf:resource="http://www.eea.europa.eu/atlas/eea/a-day-in-my-forest/satellite-images/satellite-images/bialowieza-primaeval-forest-poland"/<http://www.eea.europa.eu/atlas/eea/a-day-in-my-forest/satellite-images/satellite-images/bialowieza-primaeval-forest-poland%22/>> <dcterms:hasPart rdf:resource="http://www.eea.europa.eu/atlas/eea/a-day-in-my-forest/satellite-images/satellite-images/bialowieza-primaeval-forest-poland-1"/<http://www.eea.europa.eu/atlas/eea/a-day-in-my-forest/satellite-images/satellite-images/bialowieza-primaeval-forest-poland-1%22/>> <dcterms:hasPart rdf:resource="http://www.eea.europa.eu/atlas/eea/a-day-in-my-forest/satellite-images/satellite-images/poland-meris-forest"/<http://www.eea.europa.eu/atlas/eea/a-day-in-my-forest/satellite-images/satellite-images/poland-meris-forest%22/>> <dc:title xml:lang="en">Satellite images</dc:title> </folder:Folder> </dcterms:isPartOf> <dc:description xml:lang="en">Satellite data are an excellent tool to determine forest extent and changes in forest cover and density. Nowadays, tropical deforestation as well as reforestation and deforestation are routinely observed and monitored by satellites in the frame of the Kyoto protocol. Copyright: European Forest Institute</dc:description> <dc:modified xml:lang="en">2010/10/12 15:15:59.270 GMT+2</dc:modified> <image:id xml:lang="en">poland-forest</image:id> <dc:title xml:lang="en">Poland Forest</dc:title> </image:Image> </rdf:RDF> Kind regards, Anton |
From: Rob V. <rv...@do...> - 2010-11-15 17:21:17
|
Hi Anton Once you have retrieved the value of the Image URL (I assume you are enumerating over ts to get the value) you can use the INode that you retrieved to then make another query e.g. //Assuming you have the INode representing the image URI in a variable called url UriNode description = g.CreateUriNode("dc:description"); ts = g.GetTriplesWithSubjectPredicate(url, description); foreach (Triple t in ts) { //Do something with t.Object which will be an INode containing the description //Probably easiest to cast to literal and use the value property e.g. //((LiteralNode)t.Object).Value } Generally speaking if you want to retrieve multiple values from a Graph like this it'll usually be easier to write an appropriate SPARQL query e.g. PREFIX dc: <http://purl.org/dc/elements/1.1/> PREFIX image: <http://www.eea.europa.eu/portal_types/Image#> SELECT ?image ?description WHERE { ?image a image:Image ; dc:description ?description . } You can execute this on a Graph by using the ExecuteQuery() extension method. You'll get back a SparqlResultSet (typed as Object so you'll need to cast it explicitly to SparqlResultSet) which you can then enumerate through and get the URL and Description of each Image in the Graph. Advantage of the SPARQL method is that adding additional values to retrieve is very easy as you only have to modify your SPARQL query. Let me know if you need any more help on this. Best Regards, Rob Vesse ---------------------------------------- From: "Anton Hughes" <Ant...@ee...> Sent: 15 November 2010 16:55 To: "dot...@li..." <dot...@li...> Subject: [Dotnetrdf-support] Help retrieving value from RDF file Hi all Im currently using dotnetRDF on a project, and its working well in most cases. However Im stuck with trying to retrieve some values. the c# code I'm using is to get the image url is: //Get all Triples which meet some criteria //Want to find everything that is rdf:type ex:Person UriNode rdfType = g.CreateUriNode( "rdf:type" ); //UriNode person = g.CreateUriNode("image:Image"); //folder:Folder UriNode person = g.CreateUriNode("image:Image" ); ts = g.GetTriplesWithPredicateObject(rdfType, person); if somone could help me I would be very appreciative. Here is a sample of the rdf doc that I am using. I can retrieve the value for the image URL, but I need to get the value for the 'description'. <?xml version="1.0" encoding="utf-8"?> <rdf:RDF xmlns:dcterms='http://purl.org/dc/terms/' xmlns:folder='http://www.eea.europa.eu/portal_types/Folder#' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:dc='http://purl.org/dc/elements/1.1/' xmlns:image='http://www.eea.europa.eu/portal_types/Image#' > <image:Image rdf:about="http://www.eea.europa.eu/atlas/eea/a-day-in-my-forest/satellite-i mages/satellite-images/poland-forest"> <dc:created xml:lang="en">2010/10/12 15:10:57.842 GMT+2</dc:created> <dc:creator>deliggia</dc:creator> <dc:effective xml:lang="en">2010/09/29 17:11:35 GMT+2</dc:effective> <dcterms:isPartOf> <folder:Folder rdf:about="http://www.eea.europa.eu/atlas/eea/a-day-in-my-forest/satellite-i mages/satellite-images"> <folder:id xml:lang="en">satellite-images</folder:id> <dc:created xml:lang="en">2010/09/29 17:03:59.451 GMT+2</dc:created> <dc:creator>deliggia</dc:creator> <dc:effective xml:lang="en">2010/09/29 17:11:35 GMT+2</dc:effective> <dcterms:isPartOf rdf:resource="http://www.eea.europa.eu/atlas/eea/a-day-in-my-forest/satellit e-images"/> <dc:modified xml:lang="en">2010/09/29 17:54:54.189 GMT+2</dc:modified> <dcterms:hasPart rdf:resource="http://www.eea.europa.eu/atlas/eea/a-day-in-my-forest/satellit e-images/satellite-images/poland-forest"/> <dcterms:hasPart rdf:resource="http://www.eea.europa.eu/atlas/eea/a-day-in-my-forest/satellit e-images/satellite-images/forest-legend"/> <dcterms:hasPart rdf:resource="http://www.eea.europa.eu/atlas/eea/a-day-in-my-forest/satellit e-images/satellite-images/bialowieza-primaeval-forest-poland-2"/> <dcterms:hasPart rdf:resource="http://www.eea.europa.eu/atlas/eea/a-day-in-my-forest/satellit e-images/satellite-images/satellite-images-1"/> <dcterms:hasPart rdf:resource="http://www.eea.europa.eu/atlas/eea/a-day-in-my-forest/satellit e-images/satellite-images/bialowieza-primaeval-forest-poland"/> <dcterms:hasPart rdf:resource="http://www.eea.europa.eu/atlas/eea/a-day-in-my-forest/satellit e-images/satellite-images/bialowieza-primaeval-forest-poland-1"/> <dcterms:hasPart rdf:resource="http://www.eea.europa.eu/atlas/eea/a-day-in-my-forest/satellit e-images/satellite-images/poland-meris-forest"/> <dc:title xml:lang="en">Satellite images</dc:title> </folder:Folder> </dcterms:isPartOf> <dc:description xml:lang="en">Satellite data are an excellent tool to determine forest extent and changes in forest cover and density. Nowadays, tropical deforestation as well as reforestation and deforestation are routinely observed and monitored by satellites in the frame of the Kyoto protocol. Copyright: European Forest Institute</dc:description> <dc:modified xml:lang="en">2010/10/12 15:15:59.270 GMT+2</dc:modified> <image:id xml:lang="en">poland-forest</image:id> <dc:title xml:lang="en">Poland Forest</dc:title> </image:Image> </rdf:RDF> Kind regards, Anton |
From: Anton H. <Ant...@ee...> - 2010-11-15 15:36:32
|
Hi all Im currently using dotnetRDF on a project, and its working well in most cases. However Im stuck with trying to retrieve some values. the c# code I'm using is to get the image url is: //Get all Triples which meet some criteria //Want to find everything that is rdf:type ex:Person UriNode rdfType = g.CreateUriNode("rdf:type"); //UriNode person = g.CreateUriNode("image:Image"); //folder:Folder UriNode person = g.CreateUriNode("image:Image"); ts = g.GetTriplesWithPredicateObject(rdfType, person); if somone could help me I would be very appreciative. Here is a sample of the rdf doc that I am using. I can retrieve the value for the image URL, but I need to get the value for the 'description'. <?xml version="1.0" encoding="utf-8"?> <rdf:RDF xmlns:dcterms='http://purl.org/dc/terms/' xmlns:folder='http://www.eea.europa.eu/portal_types/Folder#' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:dc='http://purl.org/dc/elements/1.1/' xmlns:image='http://www.eea.europa.eu/portal_types/Image#' > <image:Image rdf:about="http://www.eea.europa.eu/atlas/eea/a-day-in-my-forest/satellite-images/satellite-images/poland-forest"> <dc:created xml:lang="en">2010/10/12 15:10:57.842 GMT+2</dc:created> <dc:creator>deliggia</dc:creator> <dc:effective xml:lang="en">2010/09/29 17:11:35 GMT+2</dc:effective> <dcterms:isPartOf> <folder:Folder rdf:about="http://www.eea.europa.eu/atlas/eea/a-day-in-my-forest/satellite-images/satellite-images"> <folder:id xml:lang="en">satellite-images</folder:id> <dc:created xml:lang="en">2010/09/29 17:03:59.451 GMT+2</dc:created> <dc:creator>deliggia</dc:creator> <dc:effective xml:lang="en">2010/09/29 17:11:35 GMT+2</dc:effective> <dcterms:isPartOf rdf:resource="http://www.eea.europa.eu/atlas/eea/a-day-in-my-forest/satellite-images"/> <dc:modified xml:lang="en">2010/09/29 17:54:54.189 GMT+2</dc:modified> <dcterms:hasPart rdf:resource="http://www.eea.europa.eu/atlas/eea/a-day-in-my-forest/satellite-images/satellite-images/poland-forest"/> <dcterms:hasPart rdf:resource="http://www.eea.europa.eu/atlas/eea/a-day-in-my-forest/satellite-images/satellite-images/forest-legend"/> <dcterms:hasPart rdf:resource="http://www.eea.europa.eu/atlas/eea/a-day-in-my-forest/satellite-images/satellite-images/bialowieza-primaeval-forest-poland-2"/> <dcterms:hasPart rdf:resource="http://www.eea.europa.eu/atlas/eea/a-day-in-my-forest/satellite-images/satellite-images/satellite-images-1"/> <dcterms:hasPart rdf:resource="http://www.eea.europa.eu/atlas/eea/a-day-in-my-forest/satellite-images/satellite-images/bialowieza-primaeval-forest-poland"/> <dcterms:hasPart rdf:resource="http://www.eea.europa.eu/atlas/eea/a-day-in-my-forest/satellite-images/satellite-images/bialowieza-primaeval-forest-poland-1"/> <dcterms:hasPart rdf:resource="http://www.eea.europa.eu/atlas/eea/a-day-in-my-forest/satellite-images/satellite-images/poland-meris-forest"/> <dc:title xml:lang="en">Satellite images</dc:title> </folder:Folder> </dcterms:isPartOf> <dc:description xml:lang="en">Satellite data are an excellent tool to determine forest extent and changes in forest cover and density. Nowadays, tropical deforestation as well as reforestation and deforestation are routinely observed and monitored by satellites in the frame of the Kyoto protocol. Copyright: European Forest Institute</dc:description> <dc:modified xml:lang="en">2010/10/12 15:15:59.270 GMT+2</dc:modified> <image:id xml:lang="en">poland-forest</image:id> <dc:title xml:lang="en">Poland Forest</dc:title> </image:Image> </rdf:RDF> Kind regards, Anton |
From: Rob V. <ra...@ec...> - 2010-11-09 10:04:56
|
Hi Sergey Apologies, was due to a dumb bug left from the previous bug fix for this. Fixed as of revision 1157 Thanks for your patience, Rob From: Sergey Novikov [mailto:ser...@gm...] Sent: 09 November 2010 08:13 To: Rob Vesse Subject: Re: [Dotnetrdf-support] Cyrilic letters doesnot work in SPARQL to Sesame Hi, Rob. I've downloaded latest Trunk yesterday and it seems that nothing is working. All queries cause "A HTTP error occurred while querying the Store". With inner exception {"The remote server returned an error: (400) Bad Request."} Examples of queries is: //-- DESCRIBE <http://ruslan-com.ru/assets/test2> //-- select ?CategoryUri ?CategoryName WHERE { ?CategoryUri rdf:type <http://ruslan-com.ru/mediaontology/TVCCategories>. ?CategoryUri rdfs:label ?CategoryName. } etc... queries are extremely simple and it is looks like dumb bug left when last changes were made. Best regards, Sergey Novikov On Wed, Nov 3, 2010 at 7:41 PM, Rob Vesse <ra...@ec...> wrote: Hi Sergey This issue is fixed in Trunk as of revision 1130 The issue is not currently fixed in the 0.4.0 Branch as I'm planning on changing how I serialize SPARQL queries to strings so the fix will be somewhat more elegant there (but requires some as yet unfinished code refactoring) but cannot be made yet. Rob On Tue, 2 Nov 2010 20:04:24 +0300, Sergey Novikov <ser...@gm...> wrote: Hi Rob Good to hear that. If you are in touch with Sesame Windows Client guys about this problem - please forward them screenshoot on the very the same topic. They also don't have everything clear about this issue, but instead of problem in quering they have a problem with displaying. Best regards, Sergey Novikov On Tue, Nov 2, 2010 at 5:34 PM, Rob Vesse <ra...@ec...> wrote: Hi Sergey I believe I have identified the source of the problem. I am attempting to confirm this with the Sesame Windows Client guys who know more about Sesame than I do and once confirmed I should be able to provide a fix tomorrow. Thanks for your patience Rob Vesse From: Sergey Novikov [mailto:ser...@gm...] Sent: 02 November 2010 08:33 To: Rob Vesse Subject: Fwd: [Dotnetrdf-support] Cyrilic letters doesnot work in SPARQL to Sesame Hi Rob. In case previous messgge didn't go throw your spam filter here is just text files from project. For content of previous message look bellow. Best regards, Sergey Novikov ---------- Forwarded message ---------- From: Sergey Novikov <ser...@gm...> Date: Tue, Nov 2, 2010 at 10:42 AM Subject: Re: [Dotnetrdf-support] Cyrilic letters doesnot work in SPARQL to Sesame To: Rob Vesse <ra...@ec...> Hi, Rob I've just made test project and sample data rdf file (test.rdf for uploading to sesame repository.) with just two plain statements. One with Russian chars in literal other without. The only thing that project does is query this two statements and instead of returning two literal values it return just one - with English chars only. Once again - I've tested the same query with other tool and it works fine in the same environment. Best regards, Sergey Novikov On Mon, Nov 1, 2010 at 9:17 PM, Sergey Novikov <ser...@gm...> wrote: Hi, Rob. Thank you for your reply I'll prepare a test sample for you tomorrow. Yes I'm using Sesame as Triple store and as far as I remember I'm using SesameHttpProtocolConnector. Best regards, Sergey Novikov On Mon, Nov 1, 2010 at 6:34 PM, Rob Vesse <ra...@ec...> wrote: Hi Sergey Can you please send me some more information to help me track down the source of the problem: 1. Can you send some sample data 2. Can you send sample code that you use to make the queries? I assume from your message that you are using Sesame as the Triple Store and that you are using either SesameHttpProtocolConnector or SparqlRemoteEndpoint to make queries to the Store? I suspect that you are probably right and I’m not setting the encoding correctly somewhere when sending the query to the remote endpoint but without the above I can’t easily test/narrow down the source of the bug Thanks, Rob Vesse From: Sergey Novikov [mailto:ser...@gm...] Sent: 01 November 2010 15:24 To: dot...@li... Subject: [Dotnetrdf-support] Cyrilic letters doesnot work in SPARQL to Sesame Hi I'm having a problem with Russian language in SPARQL. With the same storage this one is working: select * WHERE {?AssetURI <http://www.ontotext.com/luceneQuery> "test". } And this is one not (returns 0 results) select * WHERE {?AssetURI <http://www.ontotext.com/luceneQuery> "Москва". } At the same time both of these queries does work perfectly in "Sesame 2 Windows Client" that use the same end SPARQL endpoint. And return some results for this queries. At the same time returning literals with Russian letters works fine. Probably there is encoding issues somewhere in protocol that makes it works in wrong way. I'm working with sesame 2.3.1 and OWLIM with lucene index on top of it(if it does matter). Best regards, Sergey Novikov -- PhD Student IAM Group Bay 20, Room 4027, Building 32 Electronics & Computer Science University of Southampton |
From: Rob V. <ra...@ec...> - 2010-11-03 16:41:23
|
Hi Sergey This issue is fixed in Trunk as of revision 1130 The issue is not currently fixed in the 0.4.0 Branch as I'm planning on changing how I serialize SPARQL queries to strings so the fix will be somewhat more elegant there (but requires some as yet unfinished code refactoring) but cannot be made yet. Rob On Tue, 2 Nov 2010 20:04:24 +0300, Sergey Novikov wrote: Hi Rob Good to hear that. If you are in touch with Sesame Windows Client guys about this problem - please forward them screenshoot on the very the same topic. They also don't have everything clear about this issue, but instead of problem in quering they have a problem with displaying. Best regards, Sergey Novikov On Tue, Nov 2, 2010 at 5:34 PM, Rob Vesse wrote: Hi Sergey I believe I have identified the source of the problem. I am attempting to confirm this with the Sesame Windows Client guys who know more about Sesame than I do and once confirmed I should be able to provide a fix tomorrow. Thanks for your patience Rob Vesse FROM: Sergey Novikov [mailto:ser...@gm... [2]] SENT: 02 November 2010 08:33 TO: Rob Vesse SUBJECT: Fwd: [Dotnetrdf-support] Cyrilic letters doesnot work in SPARQL to Sesame Hi Rob. In case previous messgge didn't go throw your spam filter here is just text files from project. For content of previous message look bellow. Best regards, Sergey Novikov ---------- Forwarded message ---------- From: SERGEY NOVIKOV Date: Tue, Nov 2, 2010 at 10:42 AM Subject: Re: [Dotnetrdf-support] Cyrilic letters doesnot work in SPARQL to Sesame To: Rob Vesse Hi, Rob I've just made test project and sample data rdf file (test.rdf for uploading to sesame repository.) with just two plain statements. One with Russian chars in literal other without. The only thing that project does is query this two statements and instead of returning two literal values it return just one - with English chars only. Once again - I've tested the same query with other tool and it works fine in the same environment. Best regards, Sergey Novikov On Mon, Nov 1, 2010 at 9:17 PM, Sergey Novikov wrote: Hi, Rob. Thank you for your reply I'll prepare a test sample for you tomorrow. Yes I'm using Sesame as Triple store and as far as I remember I'm using SesameHttpProtocolConnector. Best regards, Sergey Novikov On Mon, Nov 1, 2010 at 6:34 PM, Rob Vesse wrote: Hi Sergey Can you please send me some more information to help me track down the source of the problem: 1. Can you send some sample data 2. Can you send sample code that you use to make the queries? I assume from your message that you are using Sesame as the Triple Store and that you are using either SesameHttpProtocolConnector or SparqlRemoteEndpoint to make queries to the Store? I suspect that you are probably right and I'm not setting the encoding correctly somewhere when sending the query to the remote endpoint but without the above I can't easily test/narrow down the source of the bug Thanks, Rob Vesse FROM: Sergey Novikov [mailto:ser...@gm... [7]] SENT: 01 November 2010 15:24 TO: dot...@li... [8] SUBJECT: [Dotnetrdf-support] Cyrilic letters doesnot work in SPARQL to Sesame Hi I'm having a problem with Russian language in SPARQL. With the same storage this one is working: select * WHERE {?AssetURI "test". } And this is one not (returns 0 results) select * WHERE {?AssetURI "Москва". } At the same time both of these queries does work perfectly in "Sesame 2 Windows Client" that use the same end SPARQL endpoint. And return some results for this queries. At the same time returning literals with Russian letters works fine. Probably there is encoding issues somewhere in protocol that makes it works in wrong way. I'm working with sesame 2.3.1 and OWLIM with lucene index on top of it(if it does matter). Best regards, Sergey Novikov -- PhD Student IAM Group Bay 20, Room 4027, Building 32 Electronics & Computer Science University of Southampton Links: ------ [1] mailto:ra...@ec... [2] mailto:ser...@gm... [3] mailto:ser...@gm... [4] mailto:ra...@ec... [5] mailto:ser...@gm... [6] mailto:ra...@ec... [7] mailto:ser...@gm... [8] mailto:dot...@li... [9] http://www.ontotext.com/luceneQuery [10] http://www.ontotext.com/luceneQuery |
From: Rob V. <ra...@ec...> - 2010-11-02 14:35:27
|
Hi Sergey I believe I have identified the source of the problem. I am attempting to confirm this with the Sesame Windows Client guys who know more about Sesame than I do and once confirmed I should be able to provide a fix tomorrow. Thanks for your patience Rob Vesse From: Sergey Novikov [mailto:ser...@gm...] Sent: 02 November 2010 08:33 To: Rob Vesse Subject: Fwd: [Dotnetrdf-support] Cyrilic letters doesnot work in SPARQL to Sesame Hi Rob. In case previous messgge didn't go throw your spam filter here is just text files from project. For content of previous message look bellow. Best regards, Sergey Novikov ---------- Forwarded message ---------- From: Sergey Novikov <ser...@gm...> Date: Tue, Nov 2, 2010 at 10:42 AM Subject: Re: [Dotnetrdf-support] Cyrilic letters doesnot work in SPARQL to Sesame To: Rob Vesse <ra...@ec...> Hi, Rob I've just made test project and sample data rdf file (test.rdf for uploading to sesame repository.) with just two plain statements. One with Russian chars in literal other without. The only thing that project does is query this two statements and instead of returning two literal values it return just one - with English chars only. Once again - I've tested the same query with other tool and it works fine in the same environment. Best regards, Sergey Novikov On Mon, Nov 1, 2010 at 9:17 PM, Sergey Novikov <ser...@gm...> wrote: Hi, Rob. Thank you for your reply I'll prepare a test sample for you tomorrow. Yes I'm using Sesame as Triple store and as far as I remember I'm using SesameHttpProtocolConnector. Best regards, Sergey Novikov On Mon, Nov 1, 2010 at 6:34 PM, Rob Vesse <ra...@ec...> wrote: Hi Sergey Can you please send me some more information to help me track down the source of the problem: 1. Can you send some sample data 2. Can you send sample code that you use to make the queries? I assume from your message that you are using Sesame as the Triple Store and that you are using either SesameHttpProtocolConnector or SparqlRemoteEndpoint to make queries to the Store? I suspect that you are probably right and I’m not setting the encoding correctly somewhere when sending the query to the remote endpoint but without the above I can’t easily test/narrow down the source of the bug Thanks, Rob Vesse From: Sergey Novikov [mailto:ser...@gm...] Sent: 01 November 2010 15:24 To: dot...@li... Subject: [Dotnetrdf-support] Cyrilic letters doesnot work in SPARQL to Sesame Hi I'm having a problem with Russian language in SPARQL. With the same storage this one is working: select * WHERE {?AssetURI <http://www.ontotext.com/luceneQuery> "test". } And this is one not (returns 0 results) select * WHERE {?AssetURI <http://www.ontotext.com/luceneQuery> "Москва". } At the same time both of these queries does work perfectly in "Sesame 2 Windows Client" that use the same end SPARQL endpoint. And return some results for this queries. At the same time returning literals with Russian letters works fine. Probably there is encoding issues somewhere in protocol that makes it works in wrong way. I'm working with sesame 2.3.1 and OWLIM with lucene index on top of it(if it does matter). Best regards, Sergey Novikov |
From: Rob V. <ra...@ec...> - 2010-11-01 15:34:37
|
Hi Sergey Can you please send me some more information to help me track down the source of the problem: 1. Can you send some sample data 2. Can you send sample code that you use to make the queries? I assume from your message that you are using Sesame as the Triple Store and that you are using either SesameHttpProtocolConnector or SparqlRemoteEndpoint to make queries to the Store? I suspect that you are probably right and I’m not setting the encoding correctly somewhere when sending the query to the remote endpoint but without the above I can’t easily test/narrow down the source of the bug Thanks, Rob Vesse From: Sergey Novikov [mailto:ser...@gm...] Sent: 01 November 2010 15:24 To: dot...@li... Subject: [Dotnetrdf-support] Cyrilic letters doesnot work in SPARQL to Sesame Hi I'm having a problem with Russian language in SPARQL. With the same storage this one is working: select * WHERE {?AssetURI <http://www.ontotext.com/luceneQuery> "test". } And this is one not (returns 0 results) select * WHERE {?AssetURI <http://www.ontotext.com/luceneQuery> "Москва". } At the same time both of these queries does work perfectly in "Sesame 2 Windows Client" that use the same end SPARQL endpoint. And return some results for this queries. At the same time returning literals with Russian letters works fine. Probably there is encoding issues somewhere in protocol that makes it works in wrong way. I'm working with sesame 2.3.1 and OWLIM with lucene index on top of it(if it does matter). Best regards, Sergey Novikov |
From: Sergey N. <ser...@gm...> - 2010-11-01 15:23:48
|
Hi I'm having a problem with Russian language in SPARQL. With the same storage this one is working: select * WHERE {?AssetURI <http://www.ontotext.com/luceneQuery> "test". } And this is one not (returns 0 results) select * WHERE {?AssetURI <http://www.ontotext.com/luceneQuery> "Москва". } At the same time both of these queries does work perfectly in "Sesame 2 Windows Client" that use the same end SPARQL endpoint. And return some results for this queries. At the same time returning literals with Russian letters works fine. Probably there is encoding issues somewhere in protocol that makes it works in wrong way. I'm working with sesame 2.3.1 and OWLIM with lucene index on top of it(if it does matter). Best regards, Sergey Novikov |
From: Jacek G. <jac...@gm...> - 2010-11-01 02:02:32
|
Hi! Thanks for a great .NET library of onology tools! I have been fighting against the following problem. Please help, I have spent very much time on trying to solve it myself. Test data: @prefix : <http://jacek.gajek.rpg/>. :karczma a :scene. :trakt a :scene. :trakt :north :karczma. :jacek a :player; :in :karczma; :hasName "Jacek". :karczmarz => :npc. :pies => :npc. :kot => :npc. :stefan a :karczmarz; :in :karczma; :hasName "Stefan". :julek a :pies; :in :karczma; :hasName "Julek". The Query (GetNPCNearPlayer): SELECT DISTINCT ?x WHERE { ?x a p:npc. ?x p:in ?s. ?s a p:scene. ?p a p:player. ?p p:hasName ?pname. ?p p:in ?s. FILTER regex(?pname, "jacek", "i"). } expected result: objects which are of type :npc which are :in the same :scene as a :player which :hasName "jacek". { julek, stefan } actual result: { } (empty set) Thanks in advance! Greetings -- Jacek. |
From: Rob V. <rv...@do...> - 2010-09-29 09:26:44
|
Hi All I'm hoping to get the next release (0.3.1) made in the next couple of weeks so I'm solicitating any final feature requests/bug reports prior to this release. Fixes and Changes for this release so far are as follows: Added - New RdfXmlWriter which is a streaming writer based on FastRdfXmlWriter - New Writing.Formatting namespaces - Introduces ITripleFormatter, INodeFormatter, IUriFormatter and ICharFormatter interfaces - Provides an easy to use and reusable means of formatting nodes and triples - Refactored existing code to use formatters for writing - New Parsing.Validation namespace - Provides simple classes for validating syntax - SPARQL Views - Create Graphs which are dynamically generated from a SPARQL Query and updated when the underlying data changes/on demand - Silverlight Compatability - Emulated HtmlTextWriter and HttpUtility for Silverlight compatability - Variety of compiler symbols defined to allow various library features to be disabled - SparqlXmlParser and SparqlXmlWriter use XmlReader and XmlWriter respectively when no XML DOM API available - TriXParser and TriXWriter use XmlReader and XmlWriter respectively when no XML DOM API available Changed - Bug Fixes - SqlTripleStore initialises correctly and persists updates correctly when used with an ISparqlUpdateProcessor - More intelligent parsing of Blank Node IDs from SPARQL Results - TriG Writer outputs all required @prefix definitions and generates consistent QNames - URI Loader Cache handles File IO errors gracefully - Rare forms of Numeric Literals now supported by Turtle, N3, TriG and SPARQL Parsers - Potentially ambigious QNames and Plain Literals now no longer cause parsing errors in Turtle, N3, TriG and SPARQL Parsers - General Improvements - INamespaceMapper interface extracted and some visibility changes to NamespaceMapper methods - SPARQL Improvements - Optimisations for ASK queries - Optimisations for CONSTRUCT/DESCRIBE/SELECT where LIMIT/OFFSET is used - ASP.Net Improvements - Better caching support for BaseGraphHandler - now sends ETag in responses and may response with 304 Not Modified as appropriate Removed - Obsolete RdfXmlWriter removed Please note that I am primarily only looking for issues that should be addressed for this next release. These may be minor feature requests e.g. additional overloads of methods, error message improvements or bug reports for bugs that are not already covered in the above list. Major feature requests are always welcome but obviously these will not be considered for the immediate next release, if you would like to make such a request please let us know and we'll reply as to whether such a feature can/will be included and a tentative timeline for such a feature. Best Regards, Rob Vesse |
From: Rob V. <ra...@ec...> - 2010-08-18 10:52:51
|
Hi Sergey The NativeTripleStore is designed only as a queryable and updateable wrapper around an IGenericIOManager which the SesameHttpProtocolConnector is an implementation of. It doesn’t actually load data from the store into memory as this is potentially very costly in terms of time and memory, also currently adding a Graph to the NativeTripleStore doesn’t add it to the backing store though this will likely change in future releases. Currently to save a Graph you must use the SaveGraph() method of the SesameHttpProtocolConnector itself like so: SesameHttpProtocolConnector sesame = new SesameHttpProtocolConnector("http://example.org/sesame", "memstore"); Graph g = new Graph(); Triple tr = new Triple(g.CreateUriNode(new Uri("http://test.com/resource1")), g.CreateUriNode(new Uri("http://test.com/predicate1")), g.CreateLiteralNode("Hello world test")); g.Assert(tr); sesame.SaveGraph(g); This should hopefully have the intended result, please let me know if you need any more help Regards, Rob Vesse From: Sergey Novikov [mailto:ser...@gm...] Sent: 17 August 2010 15:40 To: dot...@li... Subject: {Disarmed} [Dotnetrdf-support] Problem with using Sesame connector in dotnetrdf Hi guys. I'm trying to use SesameHttpProtocolConnector. I'm connecting to Sesame: SesameHttpProtocolConnector sesame = new SesameHttpProtocolConnector(" <http://172.23.34.214:8080/openrdf-sesame> MailScanner has detected a possible fraud attempt from "172.23.34.21480" claiming to be http://172.23.34.214:8080/openrdf-sesame", "memstore"); NativeTripleStore store = new NativeTripleStore(sesame); I can make queries: Object results = store.ExecuteQuery("SELECT * WHERE {?s ?p ?o}"); And get correct results But when I'm trying to add statement Graph g = new Graph(); Triple tr = new Triple(g.CreateUriNode(new Uri("http://test.com/resource1")), g.CreateUriNode(new Uri("http://test.com/predicate1")), g.CreateLiteralNode("Hello world test")); g.Assert(tr); store.Add(g); Then no exeption happened nor statement being added to repository. I've tried to see store property (instance of NativeTripleStore). And found that: store.IsEmpty = true store.Graphs.Count = 0 store.Triples.Count() = 0 for my case. And that's why I can't actually use store. What am I missing? What am I doing wrong? Thank you in advance. Best regards, Sergey Novikov |
From: Sergey N. <ser...@gm...> - 2010-08-17 14:39:52
|
Hi guys. I'm trying to use SesameHttpProtocolConnector. I'm connecting to Sesame: *SesameHttpProtocolConnector sesame = new SesameHttpProtocolConnector(" http://172.23.34.214:8080/openrdf-sesame", "memstore");* *NativeTripleStore store = new NativeTripleStore(sesame);* I can make queries: *Object results = store.ExecuteQuery("SELECT * WHERE {?s ?p ?o}");* And get correct results But when I'm trying to add statement *Graph g = new Graph();* *Triple tr = new Triple(g.CreateUriNode(new Uri("http://test.com/resource1")), g.CreateUriNode(new Uri("http://test.com/predicate1")), g.CreateLiteralNode("Hello world test"));* *g.Assert(tr);* *store.Add(g);* Then no exeption happened nor statement being added to repository. I've tried to see *store *property (instance of NativeTripleStore). And found that: store.IsEmpty = true store.Graphs.Count = 0 store.Triples.Count() = 0 for my case. And that's why I can't actually use store. What am I missing? What am I doing wrong? Thank you in advance. Best regards, Sergey Novikov |
From: Rob V. <rv...@do...> - 2010-06-16 11:56:34
|
Hi Bob The issue is partly poor behaviour on the part of the script and partly a bug in dotNetRDF. The script you are using isn't sending any accept header which means the array received by the MimeTypesHelper.GetSparqlWriter(String[] ctypes, String, &contentType) function is null and therefore you get your null reference exception. This has now been fixed so that when no accept header is specified SPARQL Handlers default to returning SPARQL XML Results Format. Hopefully your example should now work as desired, let me know if it doesn't. Regards, Rob Vesse ---------------------------------------- From: "Bob DuCharme" <bo...@sn...> Sent: Wednesday, June 16, 2010 12:23 AM To: dot...@li... Subject: [Dotnetrdf-support] "Object reference not set to an instance of an object." When I paste the following URL (which issues a SPARQL query against some RDFa to find the URL of the FOAF file listed there) into a browser, it works great: http://www.dotnetrdf.org/demos/leviathan/?query=PREFIX+foaf%3A+%3Chttp%3A%2F %2Fxmlns.com%2Ffoaf%2F0.1%2F%3E%0D%0ASELECT+%3Fpage+WHERE+{%0D%0A++%3Fs+foaf %3Ahomepage+%3Chttp%3A%2F%2Fwww.snee.com%2Fbob%3E+%3B%0D%0A+++++foaf%3Apage+ %3Fpage+.}%0D%0A%0D%0A&default-graph-uri=http%3A%2F%2Fwww.w3.org%2F2007%2F08 %2FpyRdfa%2Fextract%3Furi%3Dhttp%253A%252F%252Fwww.snee.com%252Fbob%26format %3Dpretty-xml%26warnings%3Dfalse%26parser%3Dlax%26space-preserve%3Dtrue%0A&t imeout=10000 Using the LWP::Simple perl library, though, the get() command in my perl script gets the following: Error ----- 1: PREFIX foaf: 2: SELECT ?page WHERE { 3: ?s foaf:homepage ; 4: foaf:page ?page .} 5: Object reference not set to an instance of an object. at VDS.RDF.MimeTypesHelper.GetSparqlWriter(String[] ctypes, String& contentType) at VDS.RDF.Web.BaseSparqlHandler.ProcessResults(HttpContext context, Object result) at VDS.RDF.Web.FileSparqlHandler.ProcessQuery(HttpContext context, String query, List`1 userDefaultGraphs, List`1 userNamedGraphs, Int64 timeout, Boolean partialResults) I get the same if I specify the URL for the file with the RDFa in a FROM clause instead of in the &default-graph-uri parameter. This get() function has successfully retrieved query results from similar services. Does the error message above look familiar to anyone? thanks, Bob ---------------------------------------------------------------------------- -- ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo _______________________________________________ Dotnetrdf-support mailing list Dot...@li... https://lists.sourceforge.net/lists/listinfo/dotnetrdf-support |
From: Bob D. <bo...@sn...> - 2010-06-15 23:22:53
|
When I paste the following URL (which issues a SPARQL query against some RDFa to find the URL of the FOAF file listed there) into a browser, it works great: http://www.dotnetrdf.org/demos/leviathan/?query=PREFIX+foaf%3A+%3Chttp%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2F%3E%0D%0ASELECT+%3Fpage+WHERE+{%0D%0A++%3Fs+foaf%3Ahomepage+%3Chttp%3A%2F%2Fwww.snee.com%2Fbob%3E+%3B%0D%0A+++++foaf%3Apage+%3Fpage+.}%0D%0A%0D%0A&default-graph-uri=http%3A%2F%2Fwww.w3.org%2F2007%2F08%2FpyRdfa%2Fextract%3Furi%3Dhttp%253A%252F%252Fwww.snee.com%252Fbob%26format%3Dpretty-xml%26warnings%3Dfalse%26parser%3Dlax%26space-preserve%3Dtrue%0A&timeout=10000 Using the LWP::Simple perl library, though, the get() command in my perl script gets the following: Error ----- 1: PREFIX foaf: <http://xmlns.com/foaf/0.1/> 2: SELECT ?page WHERE { 3: ?s foaf:homepage <http://www.snee.com/bob> ; 4: foaf:page ?page .} 5: Object reference not set to an instance of an object. at VDS.RDF.MimeTypesHelper.GetSparqlWriter(String[] ctypes, String& contentType) at VDS.RDF.Web.BaseSparqlHandler.ProcessResults(HttpContext context, Object result) at VDS.RDF.Web.FileSparqlHandler.ProcessQuery(HttpContext context, String query, List`1 userDefaultGraphs, List`1 userNamedGraphs, Int64 timeout, Boolean partialResults) I get the same if I specify the URL for the file with the RDFa in a FROM clause instead of in the &default-graph-uri parameter. This get() function has successfully retrieved query results from similar services. Does the error message above look familiar to anyone? thanks, Bob |
From: Rob V. <rv...@do...> - 2010-05-24 09:52:07
|
Hi Jacson Sorry for taking so long to reply but I havent been very well lately. I dont entirely understand your question, yes LinqToRdf has been discontinued but I dont understand what you mean in terms of Microsofts proposal? The main difference between LinqToRdf and dotNetRDF is that LinqToRdf is just an abstraction layer over RDF and SPARQL which is based internally on the also discontinued SemWeb library [1] while dotNetRDF is a full blown RDF API with its own parsers, serializers and SPARQL implementations etc. If you have further questions please let me know Rob Vesse dotNetRDF Lead Developer ================================================================ Developer Discussion & Feature Request - dot...@li... Bug Reports - dot...@li... User Help & Support - dot...@li... Website: http://www.dotnetrdf.org User Guide: http://www.dotnetrdf.org/content.asp?pageID=User%20Guide API: http://www.dotnetrdf.org/api/ ================================================================ [1] http://razor.occams.info/code/semweb/ From: Jacson Barros [mailto:jac...@gm...] Sent: 14 May 2010 16:12 To: dot...@li... Subject: [Dotnetrdf-support] ** LINKTORDF vs DOTNETRDF HI, I´m PHD students abou Semantic Web. I am studying on framework for Semantic Web Programming. I see that java is very strong on this. However, I came across the linktordf and now with this initiative from you. It is precisely this my doubt, LInkToRDF has been discontinued .. the proposal you have been meeting with Microsoft's proposal? Thanks, Jacson |
From: Jacson B. <jac...@gm...> - 2010-05-14 15:21:34
|
HI, I´m PHD students abou Semantic Web. I am studying on framework for Semantic Web Programming. I see that java is very strong on this. However, I came across the linktordf and now with this initiative from you. It is precisely this my doubt, LInkToRDF has been discontinued .. the proposal you have been meeting with Microsoft's proposal? Thanks, Jacson |
From: Rob V. <ra...@ec...> - 2010-04-21 13:10:11
|
Hi Erika I'm not surprised you've had trouble with the OpenCalais RDF since it is rather complex and has taken me quite some time just to start figuring out how to get the information you wanted. Sorry for delay in replying but I wanted to give you as good an answer as I could. Firstly since Person nodes are URIs and will be things of type Person you need to be using the various GetTriples...() methods combined with the CreateUriNode() method e.g. Graph g = new Graph(); StringParser.Parse(g, document.RawOutput, new RdfXmlParser()); UriNode person = g.CreateUriNode(new Uri("http://s.opencalais.com/1/type/em/e/Person")); Note that in all my examples here you could replace the use of CreateUriNode() with GetUriNode(), the difference being that GetUriNode() returns null if the given Node is not found in the Graph which may not always be desirable and will require you to check each Node you need is non-null. Also CreateUriNode() will be quicker than GetUriNode(), GetUriNode() is more useful for determining if a given Node exists in a Graph. Creating the Node in the previous example only creates a Node which represents the type Person, what you are actually interested in are the actual instances of person which will be things which have a triple defining them to be of type person. Once you have the nodes which represent the actual instances of Person then you can then use that node to find further information e.g. //This example would require using VDS.RDF.Parsing; at the top of your code file //Create a node for rdf:type and use it to look up all instances of type Person UriNode rdfType = g.CreateUriNode(new Uri(RdfSpecsHelper.RdfType)); foreach (Triple t in g.GetTriplesWithPredicateObject(rdfType, person)) { //Now you can do something with each Person //The Subject of the Triple is the Node that represents an instance of a Person Console.WriteLine(t.Subject.ToString()); } The following is a sample console application which finds what you are after, sorry that it's so horribly complex but the RDF is really rather complex: using System; using System.Collections.Generic; using System.Linq; using System.Text; using VDS.RDF; using VDS.RDF.Parsing; namespace opencalais_sample { class Program { static void Main(string[] args) { Graph g = new Graph(); FileLoader.Load(g, "opencalais.rdf"); //First create the rest of the Nodes we need UriNode person = g.CreateUriNode(new Uri("http://s.opencalais.com/1/type/em/e/Person")); UriNode rdfType = g.CreateUriNode(new Uri(RdfSpecsHelper.RdfType)); UriNode personEmailAddr = g.CreateUriNode(new Uri("http://s.opencalais.com/1/type/em/r/PersonEmailAddress")); UriNode personRelation = g.CreateUriNode(new Uri("http://s.opencalais.com/1/pred/person")); UriNode emailAddrRelation = g.CreateUriNode(new Uri("http://s.opencalais.com/1/pred/emailaddress")); UriNode name = g.CreateUriNode(new Uri("http://s.opencalais.com/1/pred/name")); //Then try and select the things we are interested in foreach (Triple t in g.GetTriplesWithPredicateObject(rdfType, person)) { //The Subject of each of these Triples will be an instance of a Person //Now we want to find PersonEmailAddresses for these people foreach (Triple t2 in g.GetTriplesWithPredicateObject(personRelation, t.Subject)) { //These are things that are related to the people we have found //Ensure that they are of type PersonEmailAddress if (g.ContainsTriple(new Triple(t2.Subject, rdfType, personEmailAddr))) { //Now we can find the related email address foreach (Triple t3 in g.GetTriplesWithSubjectPredicate(t2.Subject, emailAddrRelation)) { //Then find the actual email address foreach (Triple t4 in g.GetTriplesWithSubjectPredicate(t3.Object, name)) { Console.WriteLine("Person = " + t.Subject + " Email = " + t4.Object); } } } } } Console.ReadLine(); } } } You could alternatively find the same information with the following SPARQL Query, explicit nested Graph Patterns have been used to eliminate duplicates which would otherwise be introduced. SELECT ?person ?email WHERE { ?person a <http://s.opencalais.com/1/type/em/e/Person> . { ?x <http://s.opencalais.com/1/pred/person> ?person . ?x a <http://s.opencalais.com/1/type/em/r/PersonEmailAddress> . ?x <http://s.opencalais.com/1/pred/emailaddress> ?addr . } { ?addr <http://s.opencalais.com/1/pred/name> ?email } } You can execute SPARQL Queries against a Graph by using the ExecuteQuery() extension method e.g. //This example will require using VDS.RDF.Query; at the top of your code file //We use a verbatim string so it can go over several lines and preserve the formatting (prefixed with the @ character) String query = @"SELECT ?person ?email WHERE { ?person a <http://s.opencalais.com/1/type/em/e/Person> . { ?x <http://s.opencalais.com/1/pred/person> ?person . ?x a <http://s.opencalais.com/1/type/em/r/PersonEmailAddress> . ?x <http://s.opencalais.com/1/pred/emailaddress> ?addr . } { ?addr <http://s.opencalais.com/1/pred/name> ?email } }"; Object results = g.ExecuteQuery(query); if (results is SparqlResultSet) { SparqlResultSet rset = (SparqlResultSet)results; foreach (SparqlResult r in rset) { Console.WriteLine(r.ToString()); } } Your third option is to use the Ontology API instead which is more resource centric and may make more sense to you, this is still rather complex though because of the nature of the RDF in question: using System; using System.Collections.Generic; using System.Linq; using System.Text; using VDS.RDF; using VDS.RDF.Parsing; using VDS.RDF.Ontology; class Program2 { static void Main(string[] args) { OntologyGraph g = new OntologyGraph(); FileLoader.Load(g, "opencalais.rdf"); //Get the Classes and Resources we need OntologyClass personClass = g.CreateOntologyClass(new Uri("http://s.opencalais.com/1/type/em/e/Person")); OntologyClass personEmailAddr = g.CreateOntologyClass(new Uri("http://s.opencalais.com/1/type/em/r/PersonEmailAddress")); OntologyClass emailAddrClass = g.CreateOntologyClass(new Uri("http://s.opencalais.com/1/type/em/e/EmailAddress")); OntologyProperty personRelation = g.CreateOntologyProperty(new Uri("http://s.opencalais.com/1/pred/person")); OntologyProperty emailAddrRelation = g.CreateOntologyProperty(new Uri("http://s.opencalais.com/1/pred/emailaddress")); OntologyProperty nameRelation = g.CreateOntologyProperty(new Uri("http://s.opencalais.com/1/pred/name")); //Get the PersonEmailAddress instances foreach (OntologyResource emailAddress in personEmailAddr.Instances) { //Get the People related to this email address by the person relation foreach (Triple t in g.GetTriplesWithSubjectPredicate(emailAddress.Resource, personRelation.Resource)) { //Now try and get this individual which is a Person Individual person = g.CreateIndividual(t.Object, personClass.Resource); //And finally get the actual email address foreach (Triple t2 in g.GetTriplesWithSubjectPredicate(emailAddress.Resource, emailAddrRelation.Resource)) { //Create the individual email address Individual email = g.CreateIndividual(t2.Object, emailAddrClass.Resource); //Get the actual textual value of the email address foreach (Triple t3 in g.GetTriplesWithSubjectPredicate(email.Resource, nameRelation.Resource)) { Console.WriteLine("Person = " + person.ToString() + " Email = " + t3.Object.ToString()); } } } } Console.ReadLine(); } } Hope that helps you somewhat, if you can't follow that I would suggest trying to find some simpler RDF to work with to help you learn how to navigate RDF Graphs. If you need further help please let me know. Rob Vesse From: Erika L. Borg [mailto:eri...@gm...] Sent: 20 April 2010 23:04 To: dot...@li... Subject: [Dotnetrdf-support] help needed in accessing node Hi, I'm very sorry to disturb but i'm very very new to RDF and dotnetRDF and was wondering if you could help me out on this issue. I have an RDF such as the following (output from the OpenCalais .NET project) but i cant seem to find a way to access the nodes i require. I have been trying all day to no avail :s a sample RDF is attached Graph gra = new Graph(); StringParser.Parse(gra, document.RawOutput,new RdfXmlParser()); LiteralNode l = gra.GetLiteralNode("person"); textBox1.Text += "/n"+ l.ToString(); I'm trying to access the Person nodes for instance and then subsequently the PersonEmailAddress node which containes both person and emailaddress field (so i guess its like a perant node?). i cant seem to find a way to access these nodes due to my inexperience with SPARQL and RDF. I would really really really appreciate your assistance as i'm really not sure what i should be doing =/ if you could point me out on the right direction with person and PersonEmailAddress i should be able to understnad whats going on. I would really really appreciate your help on this matter as i've been going through the guide all day long and trying different sorts of code but cant seem to get to the right thing Looking forward to hearing from you, Best Regards, Erika Borg P.S: thank you for such a wonderful RDF api in .net which is so flexible <3 |
From: Rob V. <rv...@do...> - 2010-04-08 11:04:23
|
Hi Alexander First off neither of these things are bugs, you appear to be using the CreateLiteralNode() method incorrectly and expecting the ToString() method to work differently from how it is implemented. 1. ToString() is only intended to show a quick view of the value, it does not output the value in an actual RDF syntax it just shows a raw view of the value. ToString() does not add any quotes around values 2. new Uri("xsd:dateTime") does not actually do what you are expecting it to do, xsd:dateTime as seen in much real world RDF is the QName for the full URI http://www.w3.org/2001/XMLSchema#dateTime Your issue is that xsd:dateTime is also a valid URI so when you do new URI("xsd:dateTime") you get the URI "xsd:dateTime" rather than "http://www.w3.org/2001/XMLSchema#dateTime" which is what you are intending. If you have a variable of type DateTime you can actually use the ToLiteral() extension method which turns a DateTime into a LiteralNode in the given Graph like so: DateTime temp = DateTime.Now; Graph g = new Graph(); LiteralNode myDate = temp.ToLiteral(g); There are ToLiteral() extension methods defined for a whole range of primitive .Net types which map to XML Schema Datatypes which turn them into typed LiteralNode's and automatically add the appropriate datatype URI. See http://www.dotnetrdf.org/api/index.asp?topic=VDS.RDF.LiteralExtensions Hope this helps Rob From: Alexander Sidorov [mailto:ale...@gm...] Sent: 04 April 2010 18:21 To: dot...@li... Subject: [dotNetRDF-develop] Graph.CreateLiteralNode bug Hello! I'm using Graph class CreateLiteralNode method overload that has datatype parameter and I think there is a small bug. For example this call: graph.CreateLiteralNode(creationDateTime, new Uri("xsd:dateTime")) will return 2010-04-04T16:41:19+07:00^^xsd:dateTime but should return "2010-04-04T16:41:19+07:00"^^xsd:dateTime. First, I workarounded it this way: graph.CreateLiteralNode(String.Format("\"{0}\"", creationDateTime), new Uri("xsd:dateTime")) but it doesn't work as LiteralNode's ToString method puts the whole string inside one more pair of quotes. Regards, Alexander |
From: Rob V. <ra...@ec...> - 2010-03-12 13:28:12
|
Hi all If you haven't seen already I put out the latest release of dotNetRDF yesterday which is version 0.2.1 - you can download it from the website or from SourceForge New features include: . SPARQL 1.1 - Property Paths now parsed and simple paths can be executed . RDFS Reasoning - Better RDFS reasoning support, class & property hierarchy plus domain and range based inferencing now implemented . RDFa Support - Now includes an RDFa parser which can extract triples embedded as RDFa from HTML and XHTML documents, HTML writer now embeds the Triples it writes in human readable form in machine readable RDFa form in its output as well . Storage - Stability fixes for Virtuoso, 4store, Talis and Joseki I've just put together an Ideas page [1] on the website which contains a more detailed roadmap/brainstorm of some of the stuff I plan to add in the future. If anyone has any further suggestions, ideas or feedback on any of this please post to the developer discussion list dot...@li... Thanks to everyone who contributed bug reports and feature suggestions which have helped improve the library for this release! Rob Vesse dotNetRDF Lead Developer ================================================================ Developer Discussion & Feature Request - dot...@li... Bug Reports - dot...@li... User Help & Support - dot...@li... Website: http://www.dotnetrdf.org User Guide: http://www.dotnetrdf.org/content.asp?pageID=User%20Guide API: http://www.dotnetrdf.org/api/ [1] http://www.dotnetrdf.org/content.asp?pageID=Ideas |
From: Rob V. <ra...@ec...> - 2009-10-02 13:05:40
|
Version 0.1.1 Alpha of the Library was released this past week and includes among other things the following improvements: . General Improvements o Many minor bug fixes and optimisations o Improved in-memory storage for Nodes and Triples which facilitates the Parser improvements . Parsing Improvements o All parsers are now around 20x faster o Added parsers for RDF/JSON and TriG o Support for parsing directly from Strings with format auto-detection . Serialization Improvements o All NTriple type writers are around 200x faster o Added an additional RDF/XML writers which is around 80x faster (old serializers for this are still quite slow) o Added writers for RDF/JSON and TriG o Support for writing to any TextWriter rather than just to a StreamWriter . Storage Improvements o Support for Talis Platform o Support for Virtuoso Universal Server o Revised Store format offers improved read speeds and improved write speeds in some situations . ASP.Net Integration o Added some SPARQL Handlers allowing for the easy integration of SPARQL Endpoints into websites o Added some Resource lookup Handlers allowing for easy integration of linked data publishing into websites You can download the latest versions from http://www.dotnetrdf.org and there is now a User Guide located at http://www.dotnetrdf.org/content.asp?pageID=User%20Guide Rob Vesse dotNetRDF Lead Developer ================================================================ Developer Discussion & Feature Request - dot...@li... Bug Reports - dot...@li... User Help & Support - dot...@li... Website: http://www.dotnetrdf.org API: http://www.dotnetrdf.org/content.asp?pageID=API Intellisense API: http://www.dotnetrdf.org/api/ ================================================================ |