Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[higgins-dev] JENA proposal(s) for IdAS attribute value Java Interfaces

I played around with JENA a little bit, and it looks like we could use some of the interfaces to represent attribute values in IdAS.
 
 
These both implement the RDFNode interface (http://jena.sourceforge.net/javadoc/com/hp/hpl/jena/rdf/model/RDFNode.html). So, one proposal would be to return an RDFNode from IdAS's IAttribute.getValue().  Moreover, we'd say the RDFNode will (by convention) always be either a Resource or Literal.
 
There are some oddities with this proposal:
 
- Not hooked into a model:  In JENA, RDFNodes are part of statements which are part of an RDF model. Consumers of IdAS might try to use the Resource or Literal to discover where it lies in a larger statement or in the model. CP's would likely throw some kind of "notImplemented" exception for calls like RDFNode.inModel().
 
- Unsupported update methods:  Resource defines a number of update, and transaction methods. These would not be implemented in the case where we're returning a Resource as an attribute value.
 
So, we could use these interfaces, but because they integrate with other parts of JENA, and offer update operations, we would only support a subset of the methods on them.
 
 
Another proposal would be to copy what we like about these interfaces and build our own. This might not be too hard. I'm not exactly sure how typed literals are resolved to other Java classes, but other than that, it seems like defining our own interfaces would be fairly straight-forward.
 
Jim
 
p.s. For reference, I'm attaching the Java code I used to play with Literal and Resource.

Attachment: Tutorial01.java
Description: Binary data


Back to the top