RDFa parsing with rdfQuery

63 views
Skip to first unread message

Thomas Francart

unread,
Nov 13, 2012, 12:19:20 PM11/13/12
to rdfq...@googlegroups.com
Hi

I've been trying to get a minimal example with rdfQuery for 2 hours now and it just won't work, I though I would ask for help here if someone is reading...
Here is the code :

<!DOCTYPE html>
<html>
  <head>
      <title>RDFQuery test</title>
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">

    <script src="js/jquery-1.8.2.min.js"></script>
    <script src="js/jquery.rdfquery.core-1.0.js"></script>
    <script src="js/jquery.rdfquery.rdfa-1.0.js"></script>
   
    <script type="text/javascript">
      function test() {
        var r = $('#info').rdf();
        alert(r.databank.size());
        // alert(r.databank.dump({format:'application/rdf+xml', serialize: true}));
      }
    </script>
  </head>
  <body
    onload="test();"
    prefix="dc: http://purl.org/dc/elements/1.1/"
    prefix="foaf: http://xmlns.com/foaf/0.1/">
          <p id="info">This paper was written by <span rel="dc:creator" resource="#me"><span property="foaf:name">Ben Adida</span>.</span></p>
  </body>
</html>

Always printing 0... anyone can suggest what I'm doing wrong ? I took the content example from the wiki page.
Thanks
Thomas



Stéphane Corlosquet

unread,
Nov 13, 2012, 3:16:47 PM11/13/12
to rdfq...@googlegroups.com
not sure this is the answer, but #info does not have have the namespaces defined in it. have you tried to move id="info" into the body element to see if it makes any difference? I'd also recommend using the console in firebug to debug such thing, and that way you are sure that all script have been loaded.

Steph.
 

Always printing 0... anyone can suggest what I'm doing wrong ? I took the content example from the wiki page.
Thanks

Thomas



--
You received this message because you are subscribed to the Google Groups "rdfQuery" group.
To view this discussion on the web visit https://groups.google.com/d/msg/rdfquery/-/3HqwYkhoWf0J.
To post to this group, send email to rdfq...@googlegroups.com.
To unsubscribe from this group, send email to rdfquery+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rdfquery?hl=en.



--
Steph.
Reply all
Reply to author
Forward
0 new messages