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: Rob V. <rv...@do...> - 2011-05-02 11:07:49
|
Hi Talal There is no programmatic option for this since it is a Virtuoso specific feature and not part of any SPARQL standard. However you should be able to get around this by doing the following: SparqlRemoteEndpoint endpoint = new SparqlRemoteEndpoint(new Uri("http://demo.openlinksw.com/sparql?should-sponge=soft")); endpoint.HttpMode = "POST"; String query = "SELECT * FROM <http://example.org/graph> { ?s ?p ?o }"; SparqlResultSet results = endpoint.QueryWithResultSet(query); //Do what you want with the results Note the use of the should-sponge=soft querystring parameter and the alteration of the HTTP Mode for the endpoint to POST. Obviously you should insert whatever query you need into the example above. I tested this against the endpoint you stated and it returned a HTTP 500 error but I did the same against my local Virtuoso instance and it did work so it may depend on both the query and the exact configuration of the endpoint. Please let me know if you need more help Best Regards, Rob Vesse ---------------------------------------- From: "Talal Antakyali" <tal...@gm...> Sent: 02 May 2011 11:47 To: rv...@do... Subject: dotnetrdf question (urgent) Hello... Please execuse me because my English is very weak. I need your help I use dotnetrdf library to query remote RDF data using SPARQL I am using this endpoint for my queries: http://demo.openlinksw.com/sparql But there is a problem: this endpoint (when using its web GUI) requires you to choose "Retrieve remote RDF for all missing source graphs" or otherwise you won't get any data as a result of your query I couldn't find any way in dotnetrdf library to specify this option programmatically Please help me Thank you very much |
From: Rob V. <rv...@do...> - 2011-04-20 10:16:54
|
Hi Ian As I suggested in the previous email this does appear to be an issue with how the VB compiler resolves method overloads. It appears the only workaround currently is to add a CObj() call around INode instances or to use one of the formatter accepting overloads. For the next release I will add an explicit unparameterized ToString() definition to the INode interface which will avoid the need for the CObj() call. If you encounter any other classes/interfaces that have this problem in VB please let me know so I can do the same for those classes. Regards, Rob Vesse ---------------------------------------- From: "Rob Vesse" <rv...@vd...> Sent: 10 April 2011 14:58 To: dot...@li... Subject: Re: [dotNetRDF-Support] Ontology API example Hi Ian Have confirmed your issue when the code is used with VB, seems to be something to do with the VB compiler not implicitly casting to Object. Adding a CObj() call around the t.Subject, t.Object references etc does allow you to work around this but it is rather kludgy. I am investigating whether there is a nicer workaround for VB and will get back to you when I know more. Regards, Rob Vesse ---------------------------------------- From: "Rob Vesse" <rv...@vd...> Sent: 10 April 2011 11:53 To: "dotNetRDF User Help and Support" <dot...@li...> Subject: re: [dotNetRDF-Support] Ontology API example Hi Ian Thanks for the feedback, I have updated the example to note that Ontology.rdf is an example filename and you should substitute your own filename there. The NullReferenceException on the GetTriplesWithSubjectPredicate() call is due to the fact that someclass2 is populated using the GetUriNode() method which returns null if there is no such node in the Graph, either check someclass2 for null as I have done in the updated example or use CreateUriNode() instead. With regards to the formatter parameter that should be optional, INode's have an overload of ToString() which takes the formatter parameter to allow you to control exactly how the Node is converted into a String. But they should also have the default ToString() method which all .Net objects have. Not sure if this is some VB compiler specific issue as I do all my coding in C# these days and the C# compiler doesn't insist on the formatter parameter, will look into this and get back to you. In the meantime if the compiler insists on the formatter parameter I would use an NTriplesFormatter e.g. Dim formatter As VDS.RDF.Writing.Formatting.INodeFormatter formatter = new VDS.RDF.Writing.Formatting.NTriplesFormatter(); If you have any further questions/issues please let me know Rob Vesse ---------------------------------------- From: "Ian R Fry" <ia...@fr...> Sent: 10 April 2011 11:33 To: dot...@li... Subject: SPAM-LOW: [dotNetRDF-Support] Ontology API example In the second version (showing detail Graphs and Triples) I am getting some errors. Note I have used VB.Net for a web applicaiton a) Console.WriteLine("Super Class: " + t.Object.ToString()); The tostring requires a "formatter" parameter which I have never seen before b) foreach (Triple t in g.GetTriplesWithSubjectPredicate(someClass, subClassOf)) gives Object reference not set to an instance of an object. I have imported all the classes. Here is the code Dim g1 = New Graph() FileLoader.Load(g, Server.MapPath( "data/Ontology.rdf" )) Dim someclass2, subclassof As INode someclass2 = g.GetUriNode( New Uri( "http://example.org/someClass" )) Dim t1, t2 As Triple Dim formatter As VDS.RDF.Writing.Formatting.INodeFormatter subclassof = g.CreateUriNode( New Uri(NamespaceMapper.RDFS + "subClassOf" )) For Each t1 In g.GetTriplesWithSubjectPredicate(someclass2, subclassof) <---- error Response.Write( "<br>Super Class: " + t1.Object.ToString(formatter)) <---- compiler complains if no formatter For Each t2 In g.GetTriplesWithPredicateObject(subclassof, someclass) Response.Write( "<br>Sub Class: " + t2.Subject.ToString(formatter)) Next Next love the product though Ian Fry Fry Systems |
From: Rob V. <rv...@do...> - 2011-04-11 14:43:57
|
Ah, this appears to be an omission in the library. While RDF/XML can encode the Base URI our writers don't currently serialize it. Will add this for the next release. Regards, Rob Vesse > -----Original Message----- > From: Felipe Guimarães Santos [mailto:fel...@in...] > Sent: 11 April 2011 13:18 > To: Rob Vesse > Subject: RES: [dotNetRDF-Support] Writing RDF > > I'am doing a serialization of a RDF/XML, and I'am losing the Base URI. > > Felipe Guimarães Santos | desenvolvedor > > > fel...@in... | www.invit.com.br | @sigainvit > Office: +55 34 3223.4000 - 11 2372.1072 | Mobile: +55 34 9993.5060 > > > -----Mensagem original----- > De: Rob Vesse [mailto:rv...@do...] > Enviada em: segunda-feira, 11 de abril de 2011 05:52 > Para: 'dotNetRDF User Help and Support' > Cc: Felipe Guimarães Santos > Assunto: RE: [dotNetRDF-Support] Writing RDF > > Hi Felipe > > Not all RDF serializations support the encoding of a Base URI into the > serialization. If you use a format that does not support this then you > will lose the Base URI information when you parse the generated > serialization back into a Graph. > > For your reference a quick summary of available standard serializations > and their Base URI support: > > Serializations that support Base URI encoding: > -Turtle > -N3 > -RDF/XML > > Serialization that don't support Base URI encoding: > -NTriples > -RDF/JSON > > As always let me know if you have further questions > > Rob Vesse > > > -----Original Message----- > > From: Felipe Guimarães Santos [mailto:fel...@in...] > > Sent: 10 April 2011 18:28 > > To: dot...@li... > > Subject: [dotNetRDF-Support] Writing RDF > > > > When I write a RDF from Graph object to a string it losts the baseUri > > of the Graph, why? > > I mean, when I parse the string that was generated, the Graph object > > doesn't has a baseUri. > > > > > > Thanks > > > > --------------------------------------------------------------------- > - > > - > > ------- > > Xperia(TM) PLAY > > It's a major breakthrough. An authentic gaming smartphone on the > > nation's most reliable network. > > And it wants your games. > > http://p.sf.net/sfu/verizon-sfdev > > _______________________________________________ > > dotNetRDF-Support mailing list > > dot...@li... > > https://lists.sourceforge.net/lists/listinfo/dotnetrdf-support > > > |
From: Rob V. <rv...@do...> - 2011-04-11 08:53:09
|
Hi Felipe Not all RDF serializations support the encoding of a Base URI into the serialization. If you use a format that does not support this then you will lose the Base URI information when you parse the generated serialization back into a Graph. For your reference a quick summary of available standard serializations and their Base URI support: Serializations that support Base URI encoding: -Turtle -N3 -RDF/XML Serialization that don't support Base URI encoding: -NTriples -RDF/JSON As always let me know if you have further questions Rob Vesse > -----Original Message----- > From: Felipe Guimarães Santos [mailto:fel...@in...] > Sent: 10 April 2011 18:28 > To: dot...@li... > Subject: [dotNetRDF-Support] Writing RDF > > When I write a RDF from Graph object to a string it losts the baseUri > of the Graph, why? > I mean, when I parse the string that was generated, the Graph object > doesn't has a baseUri. > > > Thanks > > ----------------------------------------------------------------------- > ------- > Xperia(TM) PLAY > It's a major breakthrough. An authentic gaming > smartphone on the nation's most reliable network. > And it wants your games. > http://p.sf.net/sfu/verizon-sfdev > _______________________________________________ > dotNetRDF-Support mailing list > dot...@li... > https://lists.sourceforge.net/lists/listinfo/dotnetrdf-support |
From: Felipe G. S. <fel...@in...> - 2011-04-10 17:28:57
|
When I write a RDF from Graph object to a string it losts the baseUri of the Graph, why? I mean, when I parse the string that was generated, the Graph object doesn't has a baseUri. Thanks |
From: Rob V. <rv...@vd...> - 2011-04-10 13:58:14
|
Hi Ian Have confirmed your issue when the code is used with VB, seems to be something to do with the VB compiler not implicitly casting to Object. Adding a CObj() call around the t.Subject, t.Object references etc does allow you to work around this but it is rather kludgy. I am investigating whether there is a nicer workaround for VB and will get back to you when I know more. Regards, Rob Vesse ---------------------------------------- From: "Rob Vesse" <rv...@vd...> Sent: 10 April 2011 11:53 To: "dotNetRDF User Help and Support" <dot...@li...> Subject: re: [dotNetRDF-Support] Ontology API example Hi Ian Thanks for the feedback, I have updated the example to note that Ontology.rdf is an example filename and you should substitute your own filename there. The NullReferenceException on the GetTriplesWithSubjectPredicate() call is due to the fact that someclass2 is populated using the GetUriNode() method which returns null if there is no such node in the Graph, either check someclass2 for null as I have done in the updated example or use CreateUriNode() instead. With regards to the formatter parameter that should be optional, INode's have an overload of ToString() which takes the formatter parameter to allow you to control exactly how the Node is converted into a String. But they should also have the default ToString() method which all .Net objects have. Not sure if this is some VB compiler specific issue as I do all my coding in C# these days and the C# compiler doesn't insist on the formatter parameter, will look into this and get back to you. In the meantime if the compiler insists on the formatter parameter I would use an NTriplesFormatter e.g. Dim formatter As VDS.RDF.Writing.Formatting.INodeFormatter formatter = new VDS.RDF.Writing.Formatting.NTriplesFormatter(); If you have any further questions/issues please let me know Rob Vesse ---------------------------------------- From: "Ian R Fry" <ia...@fr...> Sent: 10 April 2011 11:33 To: dot...@li... Subject: SPAM-LOW: [dotNetRDF-Support] Ontology API example In the second version (showing detail Graphs and Triples) I am getting some errors. Note I have used VB.Net for a web applicaiton a) Console.WriteLine("Super Class: " + t.Object.ToString()); The tostring requires a "formatter" parameter which I have never seen before b) foreach (Triple t in g.GetTriplesWithSubjectPredicate(someClass, subClassOf)) gives Object reference not set to an instance of an object. I have imported all the classes. Here is the code Dim g1 = New Graph() FileLoader.Load(g, Server.MapPath( "data/Ontology.rdf" )) Dim someclass2, subclassof As INode someclass2 = g.GetUriNode( New Uri( "http://example.org/someClass" )) Dim t1, t2 As Triple Dim formatter As VDS.RDF.Writing.Formatting.INodeFormatter subclassof = g.CreateUriNode( New Uri(NamespaceMapper.RDFS + "subClassOf" )) For Each t1 In g.GetTriplesWithSubjectPredicate(someclass2, subclassof) <---- error Response.Write( "<br>Super Class: " + t1.Object.ToString(formatter)) <---- compiler complains if no formatter For Each t2 In g.GetTriplesWithPredicateObject(subclassof, someclass) Response.Write( "<br>Sub Class: " + t2.Subject.ToString(formatter)) Next Next love the product though Ian Fry Fry Systems |
From: Rob V. <rv...@vd...> - 2011-04-10 10:54:40
|
Hi Ian Thanks for the feedback, I have updated the example to note that Ontology.rdf is an example filename and you should substitute your own filename there. The NullReferenceException on the GetTriplesWithSubjectPredicate() call is due to the fact that someclass2 is populated using the GetUriNode() method which returns null if there is no such node in the Graph, either check someclass2 for null as I have done in the updated example or use CreateUriNode() instead. With regards to the formatter parameter that should be optional, INode's have an overload of ToString() which takes the formatter parameter to allow you to control exactly how the Node is converted into a String. But they should also have the default ToString() method which all .Net objects have. Not sure if this is some VB compiler specific issue as I do all my coding in C# these days and the C# compiler doesn't insist on the formatter parameter, will look into this and get back to you. In the meantime if the compiler insists on the formatter parameter I would use an NTriplesFormatter e.g. Dim formatter As VDS.RDF.Writing.Formatting.INodeFormatter formatter = new VDS.RDF.Writing.Formatting.NTriplesFormatter(); If you have any further questions/issues please let me know Rob Vesse ---------------------------------------- From: "Ian R Fry" <ia...@fr...> Sent: 10 April 2011 11:33 To: dot...@li... Subject: SPAM-LOW: [dotNetRDF-Support] Ontology API example In the second version (showing detail Graphs and Triples) I am getting some errors. Note I have used VB.Net for a web applicaiton a) Console.WriteLine("Super Class: " + t.Object.ToString()); The tostring requires a "formatter" parameter which I have never seen before b) foreach (Triple t in g.GetTriplesWithSubjectPredicate(someClass, subClassOf)) gives Object reference not set to an instance of an object. I have imported all the classes. Here is the code Dim g1 = New Graph() FileLoader.Load(g, Server.MapPath( "data/Ontology.rdf" )) Dim someclass2, subclassof As INode someclass2 = g.GetUriNode( New Uri( "http://example.org/someClass" )) Dim t1, t2 As Triple Dim formatter As VDS.RDF.Writing.Formatting.INodeFormatter subclassof = g.CreateUriNode( New Uri(NamespaceMapper.RDFS + "subClassOf" )) For Each t1 In g.GetTriplesWithSubjectPredicate(someclass2, subclassof) <---- error Response.Write( "<br>Super Class: " + t1.Object.ToString(formatter)) <---- compiler complains if no formatter For Each t2 In g.GetTriplesWithPredicateObject(subclassof, someclass) Response.Write( "<br>Sub Class: " + t2.Subject.ToString(formatter)) Next Next love the product though Ian Fry Fry Systems |
From: Ian R F. <ia...@fr...> - 2011-04-10 03:13:29
|
In the second version (showing detail Graphs and Triples) I am getting some errors. Note I have used VB.Net for a web applicaiton a) Console.WriteLine("Super Class: " + t.Object.ToString()); The tostring requires a "formatter" parameter which I have never seen before b) foreach (Triple t in g.GetTriplesWithSubjectPredicate(someClass, subClassOf)) gives Object reference not set to an instance of an object. I have imported all the classes. Here is the code Dim g1 = New Graph() FileLoader.Load(g, Server.MapPath("data/Ontology.rdf")) Dim someclass2, subclassof As INode someclass2 = g.GetUriNode(New Uri("http://example.org/someClass")) Dim t1, t2 As Triple Dim formatter As VDS.RDF.Writing.Formatting.INodeFormatter subclassof = g.CreateUriNode(New Uri(NamespaceMapper.RDFS + "subClassOf")) For Each t1 In g.GetTriplesWithSubjectPredicate(someclass2, subclassof) <---- error Response.Write("<br>Super Class: " + t1.Object.ToString(formatter)) <---- compiler complains if no formatter For Each t2 In g.GetTriplesWithPredicateObject(subclassof, someclass) Response.Write("<br>Sub Class: " + t2.Subject.ToString(formatter)) Next Next love the product though Ian Fry Fry Systems |
From: Ian R F. <ia...@fr...> - 2011-04-10 03:13:29
|
This refers to a pre-existing rdf file called Ontology.rdf Can't seem to find it anywhere.... Ian Fry Fry Systems Pty lTD |
From: Rob V. <rv...@do...> - 2011-04-05 09:40:13
|
Hi all It is planned that the 0.4.1 branch - which contains some important improvements but also some minor breaking changes - will be merged into the Trunk at the end of the week. Anyone who is currently using 0.4.0 from SVN (i.e. the stable 0.4.0 release with some minor bug fixes) should ensure they have obtained a copy of the Trunk prior to this time. On Friday the 0.4.1 branch will be merged and we will begin integration and regression testing on the core library with a view to preparing for the 0.4.1 release at the end of April. As always if you have any questions please let me know, Regards, Rob Vesse |
From: Rob V. <rv...@do...> - 2011-03-29 16:43:44
|
Hi Felipe Tested your queries with the latest version (0.4.0) and all the queries returned 56 results as expected. The incorrect results you are seeing are due to bugs in the older versions of the library that were fixed in the 0.4.0 release. Upgrading to the 0.4.0 release should solve your problem which is available from either of the following sources: - http://www.dotnetrdf.org/content.asp?pageID=Download%20dotNetRDF - http://sourceforge.net/projects/dotnetrdf/files/Library/0.4.0%20Beta/dotnetrdf_library_040_beta.zip/download Regards, Rob Vesse ---------------------------------------- From: "Felipe Guimarães Santos" <fel...@in...> Sent: 29 March 2011 16:54 To: "rv...@vd..." <rv...@vd...>, "dotNetRDF User Help and Support" <dot...@li...> Subject: [Dotnetrdf-support] RES: SPARQL query I am using 0.3.9 versionThe ontolgy is attached. Thanks Felipe Guimarães Santos | desenvolvedor fel...@in... | www.invit.com.br | @sigainvit Office: +55 34 3223.4000 - 11 2372.1072 | Mobile: +55 34 9993.5060 De: Rob Vesse [mailto:rv...@vd...] Enviada em: terça-feira, 29 de março de 2011 12:39 Para: dotNetRDF User Help and Support Assunto: Re: [Dotnetrdf-support] SPARQL query Hi Felipe They look like they should be equivalent. This may be a bug in the engine but I can't tell without testing the queries myself for which I need the data to test against, do you have a copy/link to the food ontology as the URI in your queries does not work? Also what version of dotNetRDF are you using? There were some bug fixes to joins in the 0.4.0 release so if you are using an earlier version this may be due to bugs in previous releases. In particular the 3rd of your queries may be affected by that bug and a bug in the optimiser from the older releases. It looks like all the queries optimise reasonably using the 0.4.0 release so I just need the data to test them against to see whether it is a bug in the joins. Regards, Rob Vesse ---------------------------------------- From: "Felipe Guimarães Santos" <fel...@in...> Sent: 29 March 2011 16:17 To: "dot...@li..." <dot...@li...> Subject: [Dotnetrdf-support] SPARQL queryHi, I don't know if I missunderstood SPARQL or this is a bug.See the queries below.To me all of this queries should have the same results, but they don't have.Why? prefix fd: <http://www.agent.com/ontologies/food.owl#>prefix wine: <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#>select ?wine ?food ?body ?flavor ?sugarwhere {{?food fd:matchWithBody ?body1. ?food fd:matchWithFlavor ?flavor1. ?food fd:matchWithSugar ?sugar1.} {?wine wine:hasBody ?body. ?wine wine:hasFlavor ?flavor. ?wine wine:hasSugar ?sugar.} FILTER(?flavor1 = ?flavor) FILTER(?sugar1 = ?sugar) FILTER(?body1 = ?body) }56 results prefix fd: <http://www.agent.com/ontologies/food.owl#>prefix wine: <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#>select ?wine ?food ?body ?flavor ?sugarwhere {{?food fd:matchWithBody ?body. ?food fd:matchWithFlavor ?flavor. ?food fd:matchWithSugar ?sugar.} {?wine wine:hasBody ?body. ?wine wine:hasFlavor ?flavor. ?wine wine:hasSugar ?sugar.}}245 results prefix fd: <http://www.agent.com/ontologies/food.owl#>prefix wine: <http://www.w3..org/TR/2003/PR-owl-guide-20031209/wine#>select ?wine ?food ?body ?flavor ?sugarwhere {?food fd:matchWithBody ?body. ?food fd:matchWithFlavor ?flavor. ?food fd:matchWithSugar ?sugar. ?wine wine:hasBody ?body. ?wine wine:hasFlavor ?flavor. ?wine wine:hasSugar ?sugar.}67733 results Thanks. Felipe Guimarães Santos | desenvolvedor fel...@in... | www.invit.com.br | @sigainvit Office: +55 34 3223.4000 - 11 2372.1072 | Mobile: +55 34 9993.5060 Confidencialidade: A informação contida nesta mensagem de e-mail, incluindo quaisquer anexos, é confidencial e está reservada apenas à pessoa ou entidade para a qual foi endereçada. Se você não é o destinatário ou a pessoa responsável por encaminhar esta mensagem ao destinatário, você está, por meio desta, notificado que não deverá rever, retransmitir, imprimir, copiar, usar ou distribuir esta mensagem de e-mail ou quaisquer anexos. Caso você tenha recebido esta mensagem por engano, por favor, contate o remetente imediatamente e apague esta mensagem de seu computador ou de qualquer outro banco de dados. Muito obrigado. Confidentiality Notice: The information contained in this email message, including any attachment, is confidential and is intended only for the person or entity to which it is addressed. If you are neither the intended recipient nor the employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that you may not review, retransmit, convert to hard copy, copy, use or distribute this email message or any attachments to it. If you have received this email in error, please contact the sender immediately and delete this message from any computer or other data bank. Thank you. |
From: Rob V. <rv...@vd...> - 2011-03-29 15:40:15
|
Hi Felipe They look like they should be equivalent. This may be a bug in the engine but I can't tell without testing the queries myself for which I need the data to test against, do you have a copy/link to the food ontology as the URI in your queries does not work? Also what version of dotNetRDF are you using? There were some bug fixes to joins in the 0.4.0 release so if you are using an earlier version this may be due to bugs in previous releases. In particular the 3rd of your queries may be affected by that bug and a bug in the optimiser from the older releases. It looks like all the queries optimise reasonably using the 0.4.0 release so I just need the data to test them against to see whether it is a bug in the joins. Regards, Rob Vesse ---------------------------------------- From: "Felipe Guimarães Santos" <fel...@in...> Sent: 29 March 2011 16:17 To: "dot...@li..." <dot...@li...> Subject: [Dotnetrdf-support] SPARQL query Hi, I don't know if I missunderstood SPARQL or this is a bug.See the queries below.To me all of this queries should have the same results, but they don't have.Why? prefix fd: <http://www.agent.com/ontologies/food.owl#>prefix wine: <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#>select ?wine ?food ?body ?flavor ?sugarwhere {{?food fd:matchWithBody ?body1. ?food fd:matchWithFlavor ?flavor1. ?food fd:matchWithSugar ?sugar1.} {?wine wine:hasBody ?body. ?wine wine:hasFlavor ?flavor. ?wine wine:hasSugar ?sugar.} FILTER(?flavor1 = ?flavor) FILTER(?sugar1 = ?sugar) FILTER(?body1 = ?body) }56 results prefix fd: <http://www.agent.com/ontologies/food.owl#>prefix wine: <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#>select ?wine ?food ?body ?flavor ?sugarwhere {{?food fd:matchWithBody ?body. ?food fd:matchWithFlavor ?flavor. ?food fd:matchWithSugar ?sugar.} {?wine wine:hasBody ?body. ?wine wine:hasFlavor ?flavor. ?wine wine:hasSugar ?sugar.}}245 results prefix fd: <http://www.agent.com/ontologies/food.owl#>prefix wine: <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#>select ?wine ?food ?body ?flavor ?sugarwhere {?food fd:matchWithBody ?body. ?food fd:matchWithFlavor ?flavor. ?food fd:matchWithSugar ?sugar. ?wine wine:hasBody ?body. ?wine wine:hasFlavor ?flavor. ?wine wine:hasSugar ?sugar.}67733 results Thanks. Felipe Guimarães Santos | desenvolvedor fel...@in... | www.invit.com.br | @sigainvit Office: +55 34 3223.4000 - 11 2372.1072 | Mobile: +55 34 9993.5060 Confidencialidade: A informação contida nesta mensagem de e-mail, incluindo quaisquer anexos, é confidencial e está reservada apenas à pessoa ou entidade para a qual foi endereçada. Se você não é o destinatário ou a pessoa responsável por encaminhar esta mensagem ao destinatário, você está, por meio desta, notificado que não deverá rever, retransmitir, imprimir, copiar, usar ou distribuir esta mensagem de e-mail ou quaisquer anexos. Caso você tenha recebido esta mensagem por engano, por favor, contate o remetente imediatamente e apague esta mensagem de seu computador ou de qualquer outro banco de dados. Muito obrigado. Confidentiality Notice: The information contained in this email message, including any attachment, is confidential and is intended only for the person or entity to which it is addressed. If you are neither the intended recipient nor the employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that you may not review, retransmit, convert to hard copy, copy, use or distribute this email message or any attachments to it. If you have received this email in error, please contact the sender immediately and delete this message from any computer or other data bank. Thank you. |
From: Rob V. <rv...@do...> - 2011-03-28 09:53:14
|
Hi Regionald I'm not sure I understand your question and email subject here. dotNetRDF is licensed under a choose your own license model where you can select from the GNU GPL v3, LGPL v3 or the MIT license as appropriate for your needs: - GNU GPL - http://www.opensource.org/licenses/gpl-3.0 - LGPL - http://www.opensource.org/licenses/lgpl-3.0 - MIT - http://www.opensource.org/licenses/mit-license dotNetRDF does not use an Apache license and has absolutely no relation to the JTrac project hence why I am confused by your question and email subject If you have further questions please let me know Rob Vesse ---------------------------------------- From: "Mathebula, Regionald" <Mat...@pb...> Sent: 28 March 2011 10:33 To: dot...@li... Subject: [Dotnetrdf-support] Jtrac Can you please assist me finding the apache licensing Kind Regards Regionald MathebulaTel : 27-(0)11-514-7240 mat...@pb... ______________________________________________________________________ NOTICE: This communication and any attachments ("this message") may contain confidential information for the sole use of the intended recipient(s). Any unauthorized use, disclosure, viewing, copying, alteration, dissemination or distribution of, or reliance on this message is strictly prohibited. If you have received this message in error, or you are not an authorized recipient, please notify the sender immediately by replying to this message, delete this message and all copies from your e-mail system and destroy any printed copies. |
From: Mathebula, R. <Mat...@pb...> - 2011-03-28 09:09:54
|
Can you please assist me finding the apache licensing Kind Regards Regionald Mathebula Tel : 27-(0)11-514-7240 mat...@pb... <mailto:mat...@pb...> ______________________________________________________________________ NOTICE: This communication and any attachments ("this message") may contain confidential information for the sole use of the intended recipient(s). Any unauthorized use, disclosure, viewing, copying, alteration, dissemination or distribution of, or reliance on this message is strictly prohibited. If you have received this message in error, or you are not an authorized recipient, please notify the sender immediately by replying to this message, delete this message and all copies from your e-mail system and destroy any printed copies. |
From: Felipe G. S. <fel...@in...> - 2011-03-02 23:49:50
|
I saved a graph into the database but the nodes table has more nodes(_nodes) than the graph object(in memory) . Why? Felipe Santos |
From: Rob V. <rv...@do...> - 2011-03-02 09:44:07
|
Hi all The new release of dotNetRDF is now available. The new version is 0.4.0 and is our first official Beta release. Below is a quick summary of new features, you can read more online at http://www.dotnetrdf.org/blogitem.asp?blogID=40 or see the full Change Log in the download package. Key New Features/Improvements - Much improved SPARQL 1.1 support for both Query and Update - Graph Difference calculation - Convert/Cast Graphs and SPARQL Result Sets into DataTables - Support for simple N3 rules - Some internal restructuring to improve performance and extensibility - Various bug fixes for 0.3.1 issues As a major release this does make some breaking API changes but mostly to things that were only used internally. If you have any issues when upgrading please get in touch. You may experience some minor differences in SPARQL evaluation due to fixes to both fixes/improvements in our engine and changes made to make our implementation meet the specification better where the official test suites indicated our implementation was incorrect. We strongly recommend you upgrade to the latest version ASAP - http://www.dotnetrdf.org/content.asp?pageID=Download%20dotNetRDF - http://sourceforge.net/projects/dotnetrdf/files/Library/0.4.0%20Beta/dotnetr df_library_040_beta.zip/download Best Regards, Rob Vesse |
From: Rob V. <rv...@do...> - 2011-02-28 08:21:11
|
Hi Siddu When creating a UriNode you either must provide it with a Uri instance or a String. If you provide it with a String like you have done it is treated as a QName. You must explicitly use URIs like so: UriNode dotNetRDF = g.CreateUriNode(new Uri("http://www.dotnetrdf.org")); UriNode says = g.CreateUriNode(new Uri("http://example.org/says")); If you need any more help please let me know Rob Vesse ---------------------------------------- From: "Marulasiddappa" <sid...@ut...> Sent: 28 February 2011 07:48 To: dot...@li... Subject: [Dotnetrdf-support] (no subject) Hi, I am writing a simple code, //Need a Graph firstGraph g = new Graph(); //Create some NodesURINode dotNetRDF = g.CreateURINode("http://www.dotnetrdf.org");URINode createdBy = g.CreateURINode("http://example.org/createdBy");LiteralNode robVesse = g.CreateLiteralNode("Rob Vesse"); //Assert this TripleTriple t = new Triple(dotNetRDF, createdBy, robVesse);g.Assert(t); When I try to execute this code,I got following error, maybe it is treating http: also namespace prefix. How shall I proceed with this? RDFException: The Namespace URI for the given Prefix 'http' is not known by the in-scope NamespaceMapperStackTrace: " at VDS.RDF.NamespaceMapper.GetNamespaceUri(String prefix)\r\n at VDS.RDF.Tools.ResolveQName(String qname, NamespaceMapper nsmap, Uri baseUri)\r\n at VDS.RDF.UriNode..ctor(IGraph g, String qname)\r\n at VDS.RDF.BaseGraph.CreateUriNode(String qname)\r\n at RDFParser.ParseToRdfXmlString(List`1 triples) in f:\\UserSpiral\\App_Code\\RDFParser.cs:line 35\r\n at Spidral.UserSpiral.DataProviders.UserDataProvider.GetUser(Guid id) in f:\\UserSpiral\\App_Code\\DataProvider\\UserDataProvider.cs:line 169\r\n at Spidral.UserSpiral.Controllers.UserController.BindUser() in f:\\UserSpiral\\Controllers\\UserView.aspx.cs:line 41\r\n at Spidral.UserSpiral.Controllers.UserController.Page_Load(Object sender, EventArgs e) in f:\\UserSpiral\\Controllers\\UserView.aspx.cs:line 21\r\n at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)\r\n at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)\r\n at System.Web.UI.Control.OnLoad(EventArgs e)\r\n at System.Web.UI.Control.LoadRecursive()\r\n at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)" Can you let me know the solution to this please? Regards,Siddu |
From: Marulasiddappa <sid...@ut...> - 2011-02-28 07:03:12
|
Hi, I am writing a simple code, //Need a Graph first Graph g = new Graph(); //Create some Nodes URINode dotNetRDF = g.CreateURINode("http://www.dotnetrdf.org"); URINode createdBy = g.CreateURINode("http://example.org/createdBy"); LiteralNode robVesse = g.CreateLiteralNode("Rob Vesse"); //Assert this Triple Triple t = new Triple(dotNetRDF, createdBy, robVesse); g.Assert(t); When I try to execute this code, I got following error, maybe it is treating http: also namespace prefix. How shall I proceed with this? RDFException: The Namespace URI for the given Prefix 'http' is not known by the in-scope NamespaceMapper StackTrace: " at VDS.RDF.NamespaceMapper.GetNamespaceUri(String prefix)\r\n at VDS.RDF.Tools.ResolveQName(String qname, NamespaceMapper nsmap, Uri baseUri)\r\n at VDS.RDF.UriNode..ctor(IGraph g, String qname)\r\n at VDS.RDF.BaseGraph.CreateUriNode(String qname)\r\n at RDFParser.ParseToRdfXmlString(List`1 triples) in f:\\UserSpiral\\App_Code\\RDFParser.cs:line 35\r\n at Spidral.UserSpiral.DataProviders.UserDataProvider.GetUser(Guid id) in f:\\UserSpiral\\App_Code\\DataProvider\\UserDataProvider.cs:line 169\r\n at Spidral.UserSpiral.Controllers.UserController.BindUser() in f:\\UserSpiral\\Controllers\\UserView.aspx.cs:line 41\r\n at Spidral.UserSpiral.Controllers.UserController.Page_Load(Object sender, EventArgs e) in f:\\UserSpiral\\Controllers\\UserView.aspx.cs:line 21\r\n at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)\r\n at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)\r\n at System.Web.UI.Control.OnLoad(EventArgs e)\r\n at System.Web.UI.Control.LoadRecursive()\r\n at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)" Can you let me know the solution to this please? Regards, Siddu |
From: Rob V. <rv...@do...> - 2011-02-23 09:08:11
|
Hi Daniel It depends on what information you are after. If you have an OntologyGraph to start with then you can use CreateOntologyClass() with either a URI/Node to get an OntologyClass which has access to various information about the class. Even if you aren't using an OntologyGraph you can still just create an OntologyClass by passing in a Node and a Graph to its constructor. If you just want all Triples mentioning the class then you have the Triples, TripleWithSubject etc. properties which will give you all Triples that have the Class mentioned in them in the specified position. What I suspect you are asking is about properties which have rdfs:range and rdfs:domain of a Class? Currently there is no direct way to get this information form an OntologyClass - this can be added for future releases if it would be helpful? As a workaround for this you could do the following: OntologyGraph g = new OntologyGraph(); //Load your data into the Graph from somewhere... //Get the Class of interest OntologyClass cls = g.CreateOntologyClass(new Uri("http://example.org/yourClass")); //Find Triples where Predicate is rdfs:range or rdfs:domain and the Object is the Class UriNode rdfsRange = g.CreateUriNode(new Uri(NamespaceMapper.RDFS + "range")); UriNode rdfsDomain = g.CreateUriNode(new Uri(NamespaceMapper.RDFS + "domain")); List<OntologyProperty> ranges = new List<OntologyProperty>(); List<OntologyProperty> domains = new List<OntologyProperty>(); foreach (Triple t in cls.TriplesWithObject) { if (t.Predicate.Equals(rdfsRange)) { ranges.Add(new OntologyProperty(t.Subject, g)); } else if (t.Predicate.Equals(rdfsDomain)) { domains.Add(new OntologyProperty(t.Subject, g)); } } //Do whatever you want with the Ranges and Domains... Note that if you have an OntologyProperty you can easily get back to the classes it has as its domain and range as there are two properties - Domains and Ranges - that allow you to do this. Hope this helps, let me know if you need more help/information Regards, Rob Vesse ---------------------------------------- From: "Daniel Bittencourt" <db...@gm...> Sent: 22 February 2011 21:21 To: rv...@do... Subject: dotNetRdf ontology package Hi there! I'm studying your library and more specificaly the features of the ontology package. Although I found it very usefull to create or edit an ontology, I didn't have found many methods to get some information about the ontology. For example, given a class, a method that returns all her properties. Is there something that I'm missing or an easy way to retrieve that kind of information? Thank you for your attention, -- Daniel Bittencourt Computer Science student, Federal University of Uberlândia Brazil |
From: Rob V. <rv...@do...> - 2011-02-08 10:49:52
|
Hi Felipe It depends upon your query. If your query does not explicitly reference any Graphs then it operates only over the Graphs currently in memory. If the query references Graphs then it will load those as the query requests them. SPARQL provides two mechanisms to reference Graphs - FROM/FROM NAMED and GRAPH clauses. FROM and FROM NAMED clauses specify the Graphs that the query operates over. Graphs mentioned in a FROM clause will be loaded at the start of processing a Query since they are used to form the Default Graph which the Query operates over. Graphs mentioned in a FROM NAMED clause are loaded only if the Query contains a GRAPH clause which has a variable specifier and that variable is not already bound. You can also use the GRAPH clause with a URI to specify a fixed Graph to use. Example 1: SELECT * FROM <http://example.org/graph1> FROM NAMED <http://example.org/graph2> WHERE { ?s ?p ?o } In this example graph1 would be loaded from the Store but graph2 would not as there is no relevant GRAPH clause to cause it to be loaded Example 2: SELECT * FROM <http://example.org/graph1> FROM NAMED <http://example.org/graph2> WHERE { ?s <http://example.org/hasGraph> ?g . GRAPH ?g { ?x ?y ?z } } In this example graph1 would be loaded but again graph2 would not as although there is a GRAPH clause the Graph Specifier ?g is already bound at that point in the query. But in this query for every possible distinct value for ?g the Store will attempt to load that Graph from the Store in order to answer the Graph clause Example 3: SELECT * FROM <http://example.org/graph1> FROM NAMED <http://example.org/graph2> WHERE { GRAPH ?g { ?s ?p ?o } } In this example graph1 gets loaded but then graph2 also gets loaded in order to answer the GRAPH clause as ?g is unbound so it uses all the values specified in FROM NAMED clauses to create a Graph for the GRAPH clause. Example 4: SELECT * WHERE { GRAPH <http://example.org/graph1> { ?x ?y ?z } } In this example graph1 would be loaded as it explicitly needed to answer the Graph clause A few points to remember when using the OnDemandTripleStore: If your query references a Graph that does not exist the query will fail with an exceptionThe Store is a read-only view of your underlying store. Changing the Graphs of the OnDemandTripleStore instance does not change the underlying store.Once a Graph is loaded in memory it stays there until you dispose of the OnDemandTripleStore (or it goes out of scope and gets GC'd by .Net) - if the Graph changes in the underlying store the OnDemandTripleStore will not reflect this changeHope this helps, as always let me know if you need more help Regards, Rob Vesse ---------------------------------------- From: "Felipe Guimarães Santos" <fel...@in...> Sent: 07 February 2011 22:17 To: "dot...@li..." <dot...@li...> Subject: [Dotnetrdf-support] OnDemandTripleStore If I use OnDemandTripleStore the SPARQL query will load the graphs on demand, or it will do the Query only with the loaded Graphs? Thanks Felipe Guimarães Santos | desenvolvedor fel...@in... | www.invit.com.br | @sigainvit Office: +55 34 3223.4000 - 11 5506.8280 | Mobile: +55 34 9993.5060 Confidencialidade: A informação contida nesta mensagem de e-mail, incluindo quaisquer anexos, é confidencial e está reservada apenas à pessoa ou entidade para a qual foi endereçada. Se você não é o destinatário ou a pessoa responsável por encaminhar esta mensagem ao destinatário, você está, por meio desta, notificado que não deverá rever, retransmitir, imprimir, copiar, usar ou distribuir esta mensagem de e-mail ou quaisquer anexos. Caso você tenha recebido esta mensagem por engano, por favor, contate o remetente imediatamente e apague esta mensagem de seu computador ou de qualquer outro banco de dados. Muito obrigado. Confidentiality Notice: The information contained in this email message, including any attachment, is confidential and is intended only for the person or entity to which it is addressed. If you are neither the intended recipient nor the employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that you may not review, retransmit, convert to hard copy, copy, use or distribute this email message or any attachments to it. If you have received this email in error, please contact the sender immediately and delete this message from any computer or other data bank. Thank you. |
From: Rob V. <rv...@do...> - 2011-01-12 10:57:50
|
Hi All I wanted to make everyone aware that it is my intention to mark all the SQL Stores and their related classes as obsolete in the next release (0.4.0 Beta) of dotNetRDF. They will still be usable for the next few versions (most likely until the 0.5.x releases which will be late 2011 at the earliest) in their current forms. I am not necessarily going to remove SQL stores in their entirety but I would like to significantly restructure the existing code. It is likely that I will start from scratch and just re-implement support as IGenericIOManager implementations. It is very likely that the existing ISqlIOManager interface will be removed form the library completely. I am not yet sure whether I will modify the actual database structure or not though if I do so I will provide upgrade mechanisms for pre-existing stores in some form. One possibility which I am looking into is moving some of the hard work off onto the SQL server by making use of stored procedures instead of doing most things client side. Another possible improvement is to virtualise the data returned to some degree so that actual values aren't retrieved from the database until explicitly needed which should give a boost to read speeds in some circumstances. Despite this I would like to point out that I am introducing a couple of useful new features into the API that can benefit users of existing SQL Stores: The ability to explicitly reference the default unnamed graph in SPARQL Query and Update using the URI <dotnetrdf:default-graph> (as requested by the iRingTools team) - this improvement applies to in-memory stores as wellAn SqlDataset - this is an implementation of a new abstraction layer which allows for querying out of memory data using the library's existing Leviathan SPARQL Engine. This means that the contents of a SQL store need not be loaded into memory prior to querying them. Query Performance is not as good as in-memory querying due to the overheads of going to and from the database but this is a trade off against not needing to use large amounts of RAM to realise the data in-memory prior to querying.Alongside the aforementioned I have been working on adding support for a number of new stores (both 3rd party and internally developed) which will provide a broader range of alternative stores to SQL stores should you wish to migrate from your existing SQL Stores. If you have any questions/queries about this please let me know Best Regards, Rob Vesse |
From: Rob V. <rv...@do...> - 2010-12-21 09:57:39
|
Hello All Happy Holidays to you all! This is just an informative message to say that from today until the New Year I will be travelling visiting family for the holidays and so support requests may take longer than usual to resolve. Also there may be some issues that I am unable to resolve as I will only have my laptop and won't have access to certain software for testing and debugging - namely most of the 3rd party Triple Stores which dotNetRDF supports. I will try and respond to any support requests but can't guarantee as fast a response as I usually try to give Thanks for your understanding Rob Vesse |
From: Rob V. <rv...@do...> - 2010-12-16 08:32:12
|
Hi Tomas There is not really any rules support in the 0.3.1 release that can do what you want but it is very straightforward to do with SPARQL queries e.g. PREFIX : <http://example.org/czechRoyals#> SELECT ?grandFather ?grandSon WHERE { ?grandFather :fatherOf ?x . ?x :fatherOf ?grandSon } If you want to generate actual Triples with this data you can either turn the above into a CONSTRUCT query to generate a Graph with the additional data like so: PREFIX : <http://example.org/czechRoyals#> CONSTRUCT { ?grandFather :grandFatherOf ?grandSon . } WHERE { ?grandFather :fatherOf ?x . ?x :fatherOf ?grandSon } Or if you have a Triple Store which supports SPARQL Update (such as the TripleStore class in dotNetRDF) then you can create a SPARQL Update command to add the generated data straight back into the Store e.g. PREFIX : <http://example.org/czechRoyals#> INSERT { ?grandFather :grandFatherOf ?grandSon . } WHERE { ?grandFather :fatherOf ?x . ?x :fatherOf ?grandSon } Hope this helps you get started, please ask if you have further questions/issues. Best Regards, Rob Vesse ---------------------------------------- From: "Tomas Franek" <tom...@se...> Sent: 15 December 2010 16:25 To: rv...@do... Subject: Rulebase I tried your dotnetRDF in my school project and I need help with using rulebase. I have triples that describe Czech kings family sample: Object "Jan Lucembursky" Predicate "FatherOf" Subject "CharlesIV" Object "CharlesIV" Predicate "FatherOf" Subject "Jan" Object "CharlesIV" Predicate "FatherOf" Subject "Vaclav IV" Object "VaclavIV" Predicate "FatherOf" Subject "Marketa" . . . . . I woud like create rule "GrandFatherOf", and make qeury that show all couples grandfather and grandson(granddaughter ) can you help me with this? Tomás Franek |
From: Rob V. <rv...@vd...> - 2010-12-01 15:51:39
|
Hi Anton You can't use a semicolon to reuse a subject inside another Graph Pattern. You have to restate the subject inside the OPTIONAL clause. Therefore your query would need to be the following: "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 . OPTIONAL { ?image dc:description ?description . } }" ; The above should hopefully work fine for you Best Regards Rob Vesse ---------------------------------------- From: "Anton Hughes" <Ant...@ee...> Sent: 01 December 2010 14:50 To: "rv...@do..." <rv...@do...>, "dotNetRDF User Help and Support" <dot...@li...> Subject: Re: [Dotnetrdf-support] Help retrieving value from RDF file Hi Rob Thank you very much for your help. I have one futher question. I am currently using the following query, which works for many cases but not all: "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 }" ; If the image does not have a discription then it is not included in the result set. I have tried with the following query, however it does not work: "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 ; OPTIONAL { dc:description ?description ; } }" ; Could you perhaps assist me in writing the query so that the description is optional? Thanks and kind regards, Anton Hughes ---------------------------------------- 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-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-12-01 14:48:09
|
Hi Rob Thank you very much for your help. I have one futher question. I am currently using the following query, which works for many cases but not all: "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 }"; If the image does not have a discription then it is not included in the result set. I have tried with the following query, however it does not work: "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 ; OPTIONAL { dc:description ?description ; } }"; Could you perhaps assist me in writing the query so that the description is optional? Thanks and kind regards, Anton Hughes ________________________________ 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 |