|
|
Index
| Recent Threads
| Who's Online
| User List
| Search
| Help
| |
|
Forum has been closed down This forum has been closed down due to extensive spamming activities. Please use the mailing list instead. |
![]() |
openRDF.org Forum » Sesame & Rio: Help » Thread: HOWTO remove CONSTRUCT query duplicates? |
|
Total posts in this thread: 7 |
[Add To My Favorites] [Watch this Thread] |
| Author |
|
|
Apr 27, 2008 12:18:36 PM
bblfish Sesame Addict France Joined: Sep 13, 2004 Posts: 102 Status: Offline |
Hi I have a CONSTRUCT query and it writes a lot of triples out in duplicate to the output. What do I have to do to generate a more compact graph? Do I have to put all the results into their own context and then serialise that context/graph to output? If so it would be good if the graph could take a RDFWriter as intput. The code that I am using to make the query is the following. InputStream sprklfile = FoafPublisher.class.getResourceAsStream("resources/publishfoaf.sparql"); The SPARQL query is the following PREFIX foaf: <http://xmlns.com/foaf/0.1/> |
||
|
|
Apr 29, 2008 7:15:01 PM
james OpenRDF.org Consultant Canada Joined: Jul 21, 2005 Posts: 650 Status: Offline |
You can use the RDFInserter to insert the results of a graph query into an enforced context. ---------------------------------------- Sesame Consultant http://leighnet.ca http://jamesrdf.blogspot.com |
||
|
|
May 3, 2008 4:37:53 PM
bblfish Sesame Addict France Joined: Sep 13, 2004 Posts: 102 Status: Offline |
Thanks for the hint. Here is the code.
|
||
|
|
May 7, 2008 7:36:17 PM
bblfish Sesame Addict France Joined: Sep 13, 2004 Posts: 102 Status: Offline |
Mhh it still contains a lot of duplicates. But this is probably something related to the serialiser. See the output from the So(m)mer Address Book Java Web Start link. |
||
|
|
Jun 4, 2008 12:54:56 PM
bblfish Sesame Addict France Joined: Sep 13, 2004 Posts: 102 Status: Offline |
Ok there was a bug in my code, as I was serialising the whole repository, not just the context I thought I was. Still it would be nice to have a more beautiful Turtle serialisation. I think on the whole rdf should be published as Turtle as much as possible. When developers see XML they automatically will grab for their DOM/SAX/... toolset. When that does not work they will give up without understanding. So it would be much better to output something that will force them to look at rdf tools such as sesame for parsing. I even suggest one add a comment in serialisations such as # serialised with Sesame at http://openrdf.org/ . Learn about Turtle serialisation format at ... so people can get the tools they need when they want to do something with it. But this means that one should try as much as possible to produce human readable turtle. A few simple tricks would make that possible. Here is the request for enhancement: http://www.openrdf.org/issues/browse/RIO-63 (That request for enhancement also points to the code that shows how I use CONSTRUCT queries to publish foaf. Could be useful to other projects....) ---------------------------------------- [Edit 1 times, last edit by bblfish at Jun 4, 2008 12:56:50 PM] |
||
|
|
Jun 4, 2008 2:22:15 PM
jeen Sesame Addict The Netherlands Joined: Jan 23, 2004 Posts: 1091 Status: Offline |
I am wondering, could you perhaps achieve this effect by using an ORDER BY clause in your query? For this to work you'd have to remove the temporary repository (outrep) again and just directly push your query result into an RDFWriter... But that might work. ---------------------------------------- Researcher at AFSG - Wageningen UR |
||
|
|
Jun 5, 2008 12:18:01 PM
bblfish Sesame Addict France Joined: Sep 13, 2004 Posts: 102 Status: Offline |
Order by won't work with CONSTRUCT queries, as stated in the SPARQL spec at the end of section 9.1:
---------------------------------------- [Edit 1 times, last edit by bblfish at Jun 5, 2008 12:19:08 PM] |
|||
|
| [Show Printable Version of Thread] |