Re: CWM DBpedia Slurp Rules Weirdness

Sean B. Palmer wrote:
> I'm writing some N3 that looks for dbpedia URIs in some RDF input,
> grabs them, and then outputs all of the triples that it finds. I'm
> running into problems.
>
> Here's how I get the input file:
>
> { "1" os:argv [ os:baseAbsolute ?URI ] .
>   ?F log:uri ?URI; log:semantics ?G }
>  => { ?G a :InputGraph } .
>
> cwm dbpedia-slurp.n3 --think --purge --with input.n3
>
> That bit works. This, however, doesn't work:
>
> { ?G a :InputGraph; log:includes { ?s ?p ?o } .
>   ?o log:uri [ string:startsWith "http://dbpedia.org/resource/" ] .
>   ?o log:semantics [ log:includes { ?a ?b ?c } ] }
>    => { ?a ?b ?c } .
>
>
>   
Right here is your problem. The meaning of ?s is that the variable "s"
is declared one level above. This does not work with log:includes, and
the additional level of quoting there. You need something like

@forAll :s, :p, :o, :a, :b, :c .

{ ?G a :InputGraph; log:includes { :s :p :o } .
  :o log:uri [ string:startsWith "http://dbpedia.org/resource/" ] .
  :o log:semantics [ log:includes { :a :b :c } ] }
   => { :a :b :c } .


I'm not sure how cwm interprets when variables are declared
inconsistently like that. Weirness resulted.


Yosi

Received on Friday, 12 October 2007 14:54:51 UTC