I don't know much about the theory of deleting and updating RDF
triples to figure out the best design, but I guess it would be
relatively straightforward. But see below.
> I was thinking something like
> Augment add {n=> n -count-> ( n.graph/-/having(RDF.Type -> n) size )}
> forEach {_/-/having(RDF.Type -> OWL.Class)} on graph
Nice augmentation :) Feels kinda weird to see someone else writing
these crazy expressions.
> But after an update, that rule would need to get ran again, and the
> old value should be deleted... The augmentations could be kept in a
> new graph, and that graph dropped and regenerated after every update?
> The "on()" method of AugPreparator only seems to offer to add the
> triples to the same graph.
Actually, it executes "g ++ augmentations( g )". The "++" method is
inconsistent: while for immutable implementations it returns a new
graph, for MutableSetGraph and JenaGraph it mutates the collection.
Since Scala 2.8 collection library sets up a convention of using "++="
method for mutating state and "++" for leaving the collection
unchanged, I'm planning to fix this.
> Should there be something in there, like a
> "from()" method, that would only return the augmentations, or should I
> just construct the augmenter directly, like
> new SnBagAugmenter({_/-/having(RDF.Type -> OWL.Class)},
> List({n:GraphNode=> n -count-> ( n.graph/-/having(RDF.Type -> n)
> size )})) augmentations graph
There should be multiple methods, but the syntax is kinda messed up at
the moment. Maybe you could throw a couple of your expressions like
this so we could flesh out the most readable (DSL-ish) API. I guess
there are three cases:
- augmentations only
- graph expanded to include augmentations
- copy of the graph, expanded to include augmentations
Fixed in r204, r205.
http://code.google.com/p/scardf/source/detail?r=204
There is a loose end with predicate trees, which will be fixed soon.