On 21/03/12 10:47, Paolo Castagna wrote:
Hi Vinay,
have a look here:
http://answers.semanticweb.com/questions/1493/what-is-the-best-java-rdfa-parser
Paolo
What's more this is a cross post:
http://answers.semanticweb.com/questions/15350/extract-rdfa-from-html-using-jena?page=1#15354
vinay c wrote:
Hi i am new to Jena stuff, Couple of months ago i had used ARC and RAP
(both PHP related). I now want to work with RDF on Java platform. I have
tried quite a bit with Jena. I now know how to create resources,
properties, and add them to model etc..
One thing i could not figure out is the extraction of RDFa which is
embedded inside HTML. So could you please provide some sample code snippet
for extracting RDFa from HTML??
I saw some page saying to use GRDDL, i tried that but got following error :
log4j:WARN No appenders could be found for logger
(com.hp.hpl.jena.sparql.mgt.ARQMgt).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for
more info.
Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/commons/logging/LogFactory
Your classpath does not include the Log4j jar.
at com.hp.hpl.jena.grddl.impl.GRDDL.<clinit>(GRDDL.java:830)
at com.hp.hpl.jena.grddl.GRDDLReader.read(GRDDLReader.java:47)
at com.hp.hpl.jena.rdf.model.impl.ModelCom.read(ModelCom.java:241)
at HelloRdfWorld.main(HelloRdfWorld.java:21)
Caused by: java.lang.ClassNotFoundException:
org.apache.commons.logging.LogFactory
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 4 more
Code :
Model model = ModelFactory.createDefaultModel();
model.read("file:///C:/wamp/www/SemSearch/html/sample.html",
"GRDDL");
model.write(System.out, "RDF/XML");
Could you please help me out.. please..
Thank you,
-- Vinay