/** @deprecated Use org.apache.jena.riot.RIOT#init() */ @Deprecated public static void init() { org.apache.jena.riot.RIOT.init() ; } }
public static void register() { if ( registered ) return ; registered = true ; VERSION = getVersion() ; BUILD_DATE = getBuildDate() ; SystemInfo sysInfo2 = new SystemInfo(RIOT.riotIRI, RIOT.PATH, VERSION, BUILD_DATE) ; SystemARQ.registerSubSystem(sysInfo2) ; }
@Override protected void processModulesAndArgs() { if ( this.contains(argStrict) ) RIOT.setStrictMode(true) ; }
/** Ensure things have started - applications do not need call this. * The method is public so any part of ARQ can call it. * Note the final static initializer call */ public static void init() { if ( initialized ) return ; synchronized(initLock) { if ( initialized ) return ; initialized = true ; globalContext = defaultSettings() ; RIOT.init() ; StageBuilder.init() ; ARQMgt.init() ; // After context and after PATH/NAME/VERSION/BUILD_DATE are set MappingRegistry.addPrefixMapping(ARQ.arqSymbolPrefix, ARQ.arqParamNS) ; // This is the pattern for any subsystem to register. SystemInfo sysInfo = new SystemInfo(ARQ.arqIRI, ARQ.PATH, ARQ.VERSION, ARQ.BUILD_DATE) ; SystemARQ.registerSubSystem(sysInfo) ; // Register RIOT details here, not earlier, to avoid // initialization loops with RIOT.init() called directly. RIOT.register() ; } }
public RDFWriter build() { if ( context == null ) context = RIOT.getContext().copy(); if ( dataset == null && graph == null ) throw new RiotException("No source to be written"); return new RDFWriter(dataset, graph, format, lang, baseURI, context); }
RIOT.register() ;
/** Create a {@link ParserProfile}. */ public static ParserProfile createParserProfile(FactoryRDF factory, ErrorHandler errorHandler, IRIResolver resolver, boolean checking) { return new ParserProfileStd(factory, errorHandler, resolver, PrefixMapFactory.createForInput(), RIOT.getContext().copy(), checking, false); }
@Override public void start() { RIOT.init(); SerializerRDF.init(); }
public static void register() { if ( registered ) return ; registered = true ; VERSION = getVersion() ; BUILD_DATE = getBuildDate() ; SystemInfo sysInfo2 = new SystemInfo(RIOT.riotIRI, RIOT.PATH, VERSION, BUILD_DATE) ; SystemARQ.registerSubSystem(sysInfo2) ; }
/** Create a {@link ParserProfile} with default settings, and a specific error handler. */ public static ParserProfile createParserProfile(FactoryRDF factory, ErrorHandler errorHandler, boolean checking) { return new ParserProfileStd(factory, errorHandler, IRIResolver.create(), PrefixMapFactory.createForInput(), RIOT.getContext().copy(), checking, false); }
@Override protected void exec() { if ( modLangParse.strictMode() ) RIOT.setStrictMode(true) ; if ( modLangParse.getRDFSVocab() != null ) setup = new InferenceSetupRDFS(modLangParse.getRDFSVocab()) ; try { if ( super.getPositional().isEmpty() ) parseFile("-") ; else { boolean b = super.getPositional().size() > 1 ; for ( String fn : super.getPositional() ) { if ( b && ! super.isQuiet() ) SysRIOT.getLogger().info("File: "+fn) ; parseFile(fn) ; } } } finally { System.err.flush() ; System.out.flush() ; if ( super.getPositional().size() > 1 && modTime.timingEnabled() ) output("Total", totalTuples, totalMillis, langHandlerOverall) ; } }
public ModelSetImplJena(com.hp.hpl.jena.query.Dataset dataset) { this.dataset = dataset; this.lock = this.dataset.getLock(); org.apache.jena.riot.RIOT.init(); //wires RIOT readers/writers into Jena }
private ParserProfile makeParserProfile(IRIResolver resolver, ErrorHandler errorHandler, boolean checking) { if ( errorHandler == null ) errorHandler = ErrorHandlerFactory.errorHandlerStd; return new ParserProfileStd(RiotLib.factoryRDF(), errorHandler, resolver, PrefixMapFactory.createForInput(), RIOT.getContext().copy(), checking, false) ; }
public ModelImplJena(URI contextURI, com.hp.hpl.jena.rdf.model.Model jenaModel, Reasoning reasoning) { this.contextURI = contextURI; this.reasoning = reasoning; // re-use this.jenaModel = jenaModel; //wires RIOT readers/writers into Jena org.apache.jena.riot.RIOT.init(); // Fix for Jena lowercase language name "N-Triples": RDFReaderFImpl.setBaseReaderClassName("N-Triples", com.hp.hpl.jena.rdf.model.impl.NTripleReader.class.getName()) ; RDFWriterFImpl.setBaseWriterClassName("N-Triples", com.hp.hpl.jena.rdf.model.impl.NTripleWriter.class.getName()); applyReasoning(reasoning); }
/** Create a {@link ParserProfile}, no resolving, no prefix map. */ static ParserProfile parserProfile(ErrorHandler errorHandler) { return new ParserProfileStd(RiotLib.factoryRDF(), errorHandler, IRIResolver.createNoResolve(), PrefixMapFactory.emptyPrefixMap(), RIOT.getContext().copy(), true, false) ; }
public static void main(String[] args) { InputStream in = Utils.getResourceAsStream("data/data.ttl"); RIOT.init() ; Model model = ModelFactory.createDefaultModel(); // creates an in-memory Jena Model model.read(in, null, "TURTLE"); // parses an InputStream assuming RDF in Turtle format // Write the Jena Model in Turtle, RDF/XML and N-Triples format System.out.println("\n---- Turtle ----"); model.write(System.out, "TURTLE"); System.out.println("\n---- RDF/XML ----"); model.write(System.out, "RDF/XML"); System.out.println("\n---- RDF/XML Abbreviated ----"); model.write(System.out, "RDF/XML-ABBREV"); System.out.println("\n---- N-Triples ----"); model.write(System.out, "N-TRIPLES"); System.out.println("\n---- RDF/JSON ----"); model.write(System.out, "RDF/JSON"); }
/** Internal ParserProfile used to create nodes from strings. */ private static ParserProfile setupInternalParserProfile() { PrefixMap pmap = PrefixMapFactory.createForInput(); pmap.add("rdf", ARQConstants.rdfPrefix); pmap.add("rdfs", ARQConstants.rdfsPrefix); pmap.add("xsd", ARQConstants.xsdPrefix); pmap.add("owl" , ARQConstants.owlPrefix); pmap.add("fn" , ARQConstants.fnPrefix); pmap.add("op" , ARQConstants.fnPrefix); pmap.add("ex" , "http://example/ns#"); pmap.add("" , "http://example/"); return new ParserProfileStd(RiotLib.factoryRDF(), ErrorHandlerFactory.errorHandlerStd, IRIResolver.create(), pmap, RIOT.getContext().copy(), true, false); }