import org.semanticweb.yars.nx.parser.ParseException;
import org.semanticweb.yars.nx.parser.RdfaParser;
try {
RdfaParser parser = new RdfaParser();
parser.parseFile("path/to/htmlFile.html");
} catch (ParseException e) {
e.printStackTrace();
}
import org.semanticweb.yars.nx.namespace.RDF;
import org.semanticweb.yars.nx.Node;
import org.semanticweb.yars.nx.Resource;
RdfaParser parser = new RdfaParser();
parser.parseFile("path/to/htmlFile.html");
while (parser.hasNext()) {
Node[] triple = parser.next();
if (triple[1].equals(RDF.TYPE)) {
Resource subject = (Resource) triple[0];
Node object = triple[2];
System.out.println("Subject: " + subject.toString());
System.out.println("Object: " + object.toString());
}
}
import org.semanticweb.yars.nx.parser.ParseException;
import java.io.IOException;
RdfaParser parser = new RdfaParser();
try {
parser.parseFile("path/to/htmlFile.html");
} catch (ParseException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}