Scardf and parsing prefixes in RDF

25 views
Skip to first unread message

Sam Starling

unread,
Jan 11, 2013, 10:56:56 AM1/11/13
to sca...@googlegroups.com
Hello,

I'm trying to see if Scardf will handle prefixes. For example:

val rdf = "@prefix foo: <http://www.foo.co.uk/> . " +
  "<foo:a> <foo:b> <foo:c> ."
val graph = new JenaSerializator(N3).readFrom(new java.io.StringReader(rdf))
println(graph.triplesLike(Node, UriRef("http://www.foo.co.uk/b"), Node))

I would then expect to see the triple returned, because the prefix should have been "expanded" - <foo:b> is equivalent to <http://www.foo.co.uk/b>. This is the way I'm used to Jena working, is such a thing possible with Scardf, or have I mis-understood something?

Thanks,
Sam

Hrvoje Šimić

unread,
Jan 11, 2013, 1:24:09 PM1/11/13
to sca...@googlegroups.com
Out of the top of my head I'm guessing that if you want to use prefixes you should write;

  foo:a foo:b foo:c .

not

  <foo:a> <foo:b> <foo:c> .

Best regards,
Hrvoje

Sam S

unread,
Jan 14, 2013, 5:36:46 AM1/14/13
to sca...@googlegroups.com, hrvoj...@gmail.com
Ah yes, that would make perfect sense. Thank you Hrvoje!
Reply all
Reply to author
Forward
0 new messages