[redland] perl or commandline interface to raptor?

Dave Beckett dave.beckett at bristol.ac.uk
Thu Nov 22 12:05:52 GMT 2001


>>>Dan Brickley said:

<snip/>

> cool, that works :)
> 
> redparse /opt/mozilla/defaults/profile/JP/search.rdf
> 
> gives...
> Statement: {[urn:search:category:1], [http://home.netscape.com/NC-rdf#title],
     "Webf$g4"c5c$c"}
> ...etc
> 
> 
> More RTFM questions: does Redland keep track of the
> blankness/anonymity/genidness of nodes? From quick look I can't see how,
> unless genid nodes have null or specially stringified URI content.

At the parser side of things, Raptor does record it but inside
Redland, they become URIs relative to the doc in question. I punted
on writing code for handling them until it the RDF Core WG had had a
bash at it.  It would be straightforward to add an is_blank method to
Redland node objects.


> btw re:
> 
>  my $node2=RDF::Node->new_from_uri_string("http://example.com/";);
>  my $node3=RDF::Node->new_from_uri(new RDF::URI("http://example.com/";));

These can be merged; Perl is smart enough to work it out (actually
you can use Perl's URI objects in both methods already for different
reasons).  This is interface optimisation, I am still working on
interface completeness and just plain working :)

> ...in my RDF::RDFWeb::Node class I was doing something similar, but with
> an extra parameter which was a reference to the graph/database the node
> was affiliated with. And I'm probably going to switch things so you do
> 
> my $node = $mygraph->newURINode('http://etc');
> 
> or (cos I often want to create a whole bunch at once),
> 
> my @nodes = $mygraph->newURINode(@people);
> 
> ...wondering if you'd looked at doing something like this in your stuff.
> This is not dissimilar to Jena's node-centric view, except that nodes are
> more loosly coupled to their datasource(s), and Perl has more potential
> for a prettier shortcut Node API than Java.

In Redland; Nodes, URIs and Statements are not attached to models but
are software objects that allow them to be interfaced with models -
get/set etc.

However, I was thinking of duplicating a bunch of methods from
various classes, especially constructors, into the model class just
for convienence.  I was thinking of the parsing, storage, node and
statement classes; but these wouldn't be attached to the model in any
particular way, at least internally to Redland.  In the Perl
interface, this could be hidden and the kind of thing you give above
should be possible.

> 
> I'm mostly interested in making a nice Node-centric API with glue to query
> languages, SOAP etc. in Perl (and maybe Python); I guess there are
> different API design concerns if you're trying to do a C thing and
> maintain Perl, Python, Java etc views of that too.

Yeah, I should really write that up in more detail.

I'll just note again that cross-language debugging is really hard
with current tools.  I think I posted stuff about this before with
respect to multiple shared libraries and symbols with Perl.

<snip/>

Dave






More information about the redland-dev mailing list