So for the SnAugmenter class, it's supposed to take a function of type
GraphNode->NodeBag to select which nodes to apply the rule to.
I was wondering how to to deep selections across blank nodes with
this?
I try graph/-/having(FOAF\"account"-> Branch(FOAF
\"accountServiceHomepage"->"
http://twitter.com")) to select all people
who have an account on twitter, where foaf:account points at a blank
node, but it tells me:
java.lang.IllegalArgumentException: Cannot convert _:b8b593c0fd9a5bc31-
( (<
http://xmlns.com/foaf/0.1/accountServiceHomepage>,
{PlainLiteral("
http://twitter.com")}) ) of class org.scardf.Branch to
Node
at org.scardf.Node$.from(core.scala:67)
at org.scardf.GraphNode.has(graphnode.scala:28)
at org.scardf.having$$anonfun$apply$7$$anonfun$apply
$8.apply(converters.scala:71)
at org.scardf.having$$anonfun$apply$7$$anonfun$apply
$8.apply(converters.scala:71)
at scala.collection.TraversableLike$$anonfun$map
$1.apply(TraversableLike.scala:206)
at scala.collection.TraversableLike$$anonfun$map
$1.apply(TraversableLike.scala:206)
at scala.collection.IndexedSeqOptimized
$class.foreach(IndexedSeqOptimized.scala:34)
at scala.collection.mutable.WrappedArray.foreach(WrappedArray.scala:
32)
at scala.col...
This is with a JenaGraph.
The use-case for this is that I want to write something that, given
that a person has accounts on other services, use those service's
API's to pull in other info to load into the graph.
I was debating doing this using forward-chaining jena rules, but
scardf augmentations just being arbitrary scala code seemed like a
nicer way to go. I'm not sure if thinking about this in terms of
"graph rules" is the way to go, though. It'd be doing http calls and
generating a new graph to work on, it seems.
-Leif