java - Converting stanford parser typed dependencies to RDF format -


new stackoverflow , new rdf , typed dependencies. here got far: using stanford parser extract typed dependencies sentence in java program. wonder how convert these typed dependencies n-triples rdf format?

later write rdf sesame repository, question. asking how convert stanford parser typed dependencies rdf format? writing code in java in eclipse.

the typed dependencies sentence "john likes coke" be:

[nsubj(likes-2, john-1), root(root-0, likes-2), dobj(likes-2, coke-3)] 

converting data rdf consists of thinking things want represent, , coming vocabulary (or ontology) them. there may existing vocbulary out there thing can reuse, purpose of question, let's assume you'll mint own vocabulary.

since every vocabulary term in rdf uri, need namespace first. let's, now, settle on http://example.org/stanford (prefix sp). we'll need vocabulary terms making dependency, declaring specific type of dependency, , expressing relations between sentence fragments make dependency. keep simple, specific sentence fragment example gave modeled in rdf follows:

 @prefix sp: <http://example.org/stanford/>  @prefix : <http://example.org/>    :nsubj1 sp:nominalsubject;          sp:governor :likes-2;          sp:dependent :john-1 .   :s1 sp:root ;      sp:dependent :likes-2 .   :dobj1 sp:directobject ;         sp:governor :likes-2;         sp:dependent :coke-3.  

etc.

to make happen in java/sesame, should write reads input stanford parser, , converts each dependency on case case basis equivalent rdf terms (tip: it's idea declare constants rdf terms), , either write directly disk via sesame's rio parser/writer, build in-memory model go, or create simple repository (basically database) add rdf data.

i suggest give try, using of existing tutorials/documentation exist getting started programming using sesame. if stuck somewhere, write followup question specific problem.


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -