Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [rdf4j-dev] Creating a new Rio JSON-LD Parser

Hi Julio,

First of all apologies for not getting back to you sooner - your message slipped underneath the desk I'm afraid.

As to your question: since RDF4J uses SPI and a ServiceRegistry that is keyed on the file format, what will happen is that whichever parser is loaded last will "push out" the previous one. So when using the registry to create a parser object, it will only ever grab the one that was inserted last. The registry will log a warning about this, but it shouldn't cause any errors. The order in which parsers are loaded by the way, is determined by how the java.util.ServiceLoader returns them. See https://docs.oracle.com/javase/8/docs/api/java/util/ServiceLoader.html#iterator() .

However, you can of course still use the parser directly, by bypassing the RDFParserFactory and just manually instantiating the desired parser object.

HTH,

Jeen

On Fri, Jul 6, 2018 at 1:03 AM, Julio Caguano <julio.caguanob@xxxxxxxxx> wrote:
 Hi, 

I am working in a new Parser for RDF4J using the Rio API. I am using the librdfa library [1], which claims to be the fastest processor for JSON-LD. The library is written in C. I already have a working version in [2], which manages the bridge between the C library and the Java and implements a Parser for RDF4J.

I want to integrate this new library with Apache ANY23 that already uses Semargl [3]. This means that ANY23 will use two parsers for the same format (RDFFORMAT.JSONLD). However, I am worried how will be the behavior of the Rio API since it uses SPI to load the parsers. Is it possible to make a configuration and maintain both parsers in the same application? How can I tell that to the API?

Regards,
Julio.


_______________________________________________
rdf4j-dev mailing list
rdf4j-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/rdf4j-dev



Back to the top