[TripleStore] Re: SWAD-Europe Report: Mapping Semantic Web Data
with RDBMSes
Dave Beckett
dave.beckett at bristol.ac.uk
Tue Feb 18 15:00:06 GMT 2003
>>>Jean-Michel Hiver said:
> All I was saying is that at the moment TripleStore manages purely
> triples, i.e. (subject, object, predicate), it doesn't (yet ?) have
> support for RDF specific concepts such as namespaces.
RDF doesn't used the concept of namespaces.
Now, XML Namespaces are used in the XML serialization of RDF but
ignore that, it has nothing at all to do with the triples.
> For example, in my limited understanding of RDF, an identifier is
> necessarily a URI. TripleStore doesn't enforce that.
RDF triple parts (nodes) are URI-references or Literals or local
identifiers and the URL I gave you defines the types of all of those.
> If you have the Perl structure:
>
> my $hash = {
> address => {
> street => '1501 Grant Avenue',
> state => 'Massachusets',
> city => 'Bedford',
> zip => '01730',
> }
> };
>
> You can insert:
>
> $store->insert ('_id:1', 'address', '_id:2');
> $store->insert ('_id:2', 'street', '1501 Grant Avenue');
> $store->insert ('_id:2', 'state', 'Massachusets');
> $store->insert ('_id:2', 'city', 'Bedford');
> $store->insert ('_id:2', 'zip', '01730');
You can, but those are all strings.
> Instead of
>
> $store->insert ('http://www.example.org/staffId85740', 'address', '_someAno
nyMousID');
> $store->insert ('_someAnonyMousID', 'http://www.example.org/terms/street',
'1501 Grant Avenue');
> $store->insert ('_someAnonyMousID', 'http://www.example.org/terms/state', '
Massachusets');
> $store->insert ('_someAnonyMousID', 'http://www.example.org/terms/city', 'B
edford');
> $store->insert ('_someAnonyMousID', 'http://www.example.org/terms/zip', '01
730');
Still strings.
If you want to interpret some of the strings as URIs / RDF literals /
bnodes etc. , that would be an extra layer above or maybe you can
store real perl objs? such as new URI("http://example.org/"),
new localID('_foo') etc.
(Without using Storable or Freeze/Thaw which are a bit of a hack)
> I understand that you loose the shared vocabulary though...
?
> And that is because as a Perl programmer I can easily comprehend and map
> the concept of Perl hashes and Perl arrays to a set of triples, and use
> it as a very flexible storage mechanism.
>
> Now, am I missing anything essential? If possible I'd like TripleStore
> to be useful for more people than just me :)
It is a layering thing; you lose the URIs/literals distinction. Or
consider it as datatypes. Perl automatically de/stringifys things
without you thinking about it but that loses the typing information.
Maybe you could look at some of the perl code I have for my Redland
system
http://cvs.ilrt.org/cvsweb/redland/librdf/perl/lib/RDF/
or the RSS library I have, which is more application level and shows
how the triple-based interfaces are used:
http://cvs.ilrt.org/cvsweb/redland/librdf/perl/lib/RDF/Redland/RSS.pm?rev=1.24
All my Redland demos are done in perl, so I'm very familiar with it.
(RDF::Redland is also registered in CPAN modules list but I've not
yet got round to testing and uploading it)
> Best Regards,
>
>
> [1] http://www.w3.org/TR/1999/REC-rdf-syntax-19990222/
> [2] http://www.w3.org/TR/2003/WD-rdf-concepts-20030123/#section-data-model
Cheers
Dave
More information about the TripleStore
mailing list