[NLP2RDF] Leipzig hackathon
Martin Brümmer
der.bruemmer at googlemail.com
Mon Aug 18 13:10:15 CEST 2014
Hi Tiziano,
(adding the nlp2rdf mailing list)
there is not a single jar, but I found it works well following the
procedure:
-Checkout the software repo
-In Eclipse or your IDE of choice: Import existing maven project and
direct it to the nlp2rdf/software folder
-import the core and a reference implementation, like stanfordcorenlp
then run it as mvn install to get the dependencies. I have not tried to
generate a simple jar but maven works pretty well. It's worth checking
it out because many developers use it, although there is some love/hate
involved ;)
For using NIF, the main implementation is in Jena, using Jena OntModels,
adding NIF properties and classes to it. You can see an example in the
OpenNLPWrapper:
https://github.com/NLP2RDF/software/blob/master/java-maven/implementation/opennlp/src/main/java/org/nlp2rdf/implementation/opennlp/OpenNLPWrapper.java
in the addSpans() method (line 212):
-it generates a list of Jena resources out of an array of Spans
-a Span defines the start and the end offset of a generic String, in
this case the parameter text
-the helper class Text2RDF is used to add a generic nif:String resource
to the Jena OntModel
-then the class of the resource (nif:Word, nif:Sentence etc) is defined
and the property referenceContext is added.
to the individual resources, further nif properties can be added, as you
can see in the addWords() method (Line 172).
Relevant classes to use the nif ontology in java are these:
https://github.com/NLP2RDF/software/tree/master/java-maven/core/jena/src/main/java/org/nlp2rdf/core/vocab
regards,
Martin
Am 18.08.2014 12:39, schrieb Tiziano Flati:
> Hi Martin,
>
> I wanted to start doing something for the hackathon.
>
> Can you recommend some useful starting point for using NIF from Java?
> I searched a bit and I think that the main page where I can start from
> is this: https://github.com/NLP2RDF/software
>
> Can I start from here?
>
> I am not very confident with maven (although I've been working a bit
> with it), so can I contact you directly with some silly questions,
> should I need it?
>
> Is there any single .jar that I can work with?
>
> Thank you very much,
> Tiziano
More information about the NLP2RDF
mailing list