W3C home > Mailing lists > Public > public-cwm-bugs@w3.org > October 2007

Re: CWM DBpedia Slurp Rules Weirdness

From: Yosi Scharf <syosi@MIT.EDU>
Date: Fri, 12 Oct 2007 10:53:17 -0400
Message-ID: <470F8A5D.2000409@mit.edu>
To: "Sean B. Palmer" <sean@miscoranda.com>
CC: public-cwm-bugs@w3.org

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

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 19:52:01 UTC