...
Code Block |
---|
|
git clone https://github.com/rdfa/librdfa |
And install the library (make sure to have all the libraries that librdfa uses).
Code Block |
---|
|
./autogen.sh
./configure
make
make install |
Building from source
In order to compile librdfa-rdf4j, change into the source directory and execute install using maven.
Code Block |
---|
mvn clean install |
Install
You can install libdrfa-rdf4j adding the following maven dependency (make sure to have installed the the librdfa library):
Code Block |
---|
|
<dependency>
<groupId>org.apache.any23</groupId>
<artifactId>apache-any23-librdfa</artifactId>
<version>${librdfa.rdf4j.version}</version>
</dependency> |
Use
Once you have installed librdfa-rdf4j, you can use the parser with the Rio API. For example:
Code Block |
---|
|
RDFParser rdfParser = Rio.createParser(RDFFormat.RDFA);
Model model = new LinkedHashModel();
rdfParser.setRDFHandler(new StatementCollector(model));
rdfParser.parse(in, "http://www.example.org./"); |