Wishlists?

3 views
Skip to first unread message

azaroth

unread,
Jun 9, 2008, 5:34:13 PM6/9/08
to foresite

What do you want added to the libraries? Convenience functions, non
ORE specific things, magic namespaces, brand new functionality etc
etc.

Go wild! :)

--Rob

pkeane

unread,
Jun 9, 2008, 11:13:53 PM6/9/08
to foresite
[originally posted to OAI-ORE list]

Great stuff & very helpful! Many thanks.

Is there a plan to allow passing in data to the resource map object
that'll be used by a serialization, but not by ORE? I am thinking
specifically of atom:updated.

Also, I had validation errors noted for atom:updated .
If you are interested, here's a patch that simply gets you RFC3339
timestamps (no offsets):

serialization.py

1c1
<
---
> import time

305c305,306
< e.text = now()
---
> e.text = time.strftime("%Y-%m-%dT%H:%M:%S")+'Z'

375c376,377
< e.text = now()
---

> e.text = time.strftime("%Y-%m-%dT%H:%M:%S")+'Z'


--peter keane

Richard Jones

unread,
Jun 10, 2008, 4:41:28 AM6/10/08
to fore...@googlegroups.com
Hi Peter,

> Is there a plan to allow passing in data to the resource map object
> that'll be used by a serialization, but not by ORE? I am thinking
> specifically of atom:updated.
>

It should be possible with both libraries to add arbitrary triples (and
have them serialised), provided that the graph remains connected. In
the Java implementation this looks like this:

ResourceMap rem = ...;
URI atomUpdated = new URI("http://whatever.atom.uri/terms/Updated");
Date updated = new Date();
rem.createTriple(atomUpdated, updated);

When you serialise, you should get a triple like:

URI-REM atom:updated
"01-01-1970"^^http://www.w3.org/rdf-date-type-uri-whatever-that-is

If you attempt to create a Triple stand alone (allowed) and then add it
to the ReM without it being connected at either end, you will generate
an error, so:

ResourceMap rem = ...;
Predicate pred = new Predicate();
pred.setURI(new URI("http://whatever.atom.uri/terms/Updated"));
Triple triple = new Triple();
triple.setSubjectURI("subject-uri");
triple.setPredicate(pred);
triple.setObjectURI("object-uri");
rem.addTriple(triple);

will throw an OREException, warning you about graph connectedness.

This will all become easier to look at when the API improves (the java
implementation is still rather wordy) and the documentation on how to do
this is available :)

Cheers,

Richard

--
=======================================================================
Richard Jones | Hewlett-Packard Limited
Research Engineer, HP Labs | registered office:
Bristol, UK | Cain Road, Bracknell,
| Berks, RG12 1HN.
| Registered No: 690597 England
eml: richard...@hp.com -------------------------------------
blg: http://chronicles-of-richard.blogspot.com/
-----------------------------------------------------------------------
The contents of this message and any attachments to it are confidential
and may be legally privileged. If you have received this message in
error, you should delete it from your system immediately and advise the
sender. To any recipient of this message within HP, unless otherwise
stated you should consider this message and attachments as "HP
CONFIDENTIAL".
========================================================================

Rob Sanderson

unread,
Jun 10, 2008, 5:49:15 AM6/10/08
to fore...@googlegroups.com

On Mon, 2008-06-09 at 20:13 -0700, pkeane wrote:
> Great stuff & very helpful! Many thanks.

No problem :) Any usage stories gratefully appreciated :)

> Is there a plan to allow passing in data to the resource map object
> that'll be used by a serialization, but not by ORE? I am thinking
> specifically of atom:updated.

The term "serialization specific metadata" has been bandied about in the
past. The problem is that the main storage underneath the objects in
both libraries is an RDF graph, so for data to end up in the
serialization it has to be in the graph or somehow attached to an
object. If it doesn't have a correspondence in the ORE model, it's hard
to know where that information would go.

For atom:updated, the python library simply inserts the current time.
(serializer.py, line 304)

It would be possible to define a mapping for atom:updated (and other
such SSMs) that wouldn't be part of the ORE model directly, but would
end up serialized okay. Updated to me is closest to dcterms:modified on
the Proxy object, though I realise that it's not exactly analogous.

However I'm wary of putting in things like this in case they're confused
with official ore model mappings. Perhaps it's a topic for the main ORE
list?

On the flip sides, as Richard said, we can put in any arbitrary triples.
In python, you can add arbitrary predicates and objects to any object:

aggr = Aggregation('uri-a')
aggr.accrualPolicy = "Daily"
aggr._dcterms.isPartOf = URIRef('container')

And for arbitrary subjects:

subj = ArbitraryResource('uri-something')
subj._owl.sameAs = URIRef('uri-something-else')

You can also go the other way and have metadata that's on the object but
not serialized by default. This could be useful for implementation
specific information, such as whether or not a resource map is
authoritative for the aggregation.

rem = ResourceMap('uri-r')
rem._orex.isAuthoritativeFor = aggr.uri

To serialize with it, set public to 0 on the serializer:

srlz = AtomSerializer()
srlz.public = 0

and the information will be serialized in the same way as other rdf.
The list of internal predicates can be extended in utils.py, line 79.


> Also, I had validation errors noted for atom:updated .

Fixed and in subversion! Many thanks :)

Rob

Reply all
Reply to author
Forward
0 new messages