org.apache.jena.riot.Lang.getName()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(6.6k)|赞(0)|评价(0)|浏览(137)

本文整理了Java中org.apache.jena.riot.Lang.getName()方法的一些代码示例,展示了Lang.getName()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Lang.getName()方法的具体详情如下:
包路径:org.apache.jena.riot.Lang
类名称:Lang
方法名:getName

Lang.getName介绍

暂无

代码示例

代码示例来源:origin: apache/jena

@Override
  public String toString() {
    if ( variant == null )
      return lang.getName() ;
    return lang.getName() + "/" + variant ;
  }
}

代码示例来源:origin: org.apache.clerezza.ext/org.apache.jena.jena-arq

@Override
  public String toString() {
    if ( variant == null )
      return lang.getName() ;
    return lang.getName() + "/" + variant ;
  }
}

代码示例来源:origin: apache/jena

@Override
public final <TKey> RecordWriter<TKey, QuadWritable> createQuadWriter(Writer writer, Configuration config)
    throws IOException {
  throw new IOException(this.lang.getName() + " does not support writing quads");
}

代码示例来源:origin: apache/jena

@Override
public final <TKey> RecordWriter<TKey, TripleWritable> createTripleWriter(Writer writer, Configuration config)
    throws IOException {
  throw new IOException(this.lang.getName() + " does not support writing triples");
}

代码示例来源:origin: org.apache.jena/jena-elephas-io

@Override
public final <TKey> RecordWriter<TKey, QuadWritable> createQuadWriter(Writer writer, Configuration config)
    throws IOException {
  throw new IOException(this.lang.getName() + " does not support writing quads");
}

代码示例来源:origin: org.apache.jena/jena-elephas-io

@Override
public final <TKey> RecordWriter<TKey, TripleWritable> createTripleWriter(Writer writer, Configuration config)
    throws IOException {
  throw new IOException(this.lang.getName() + " does not support writing triples");
}

代码示例来源:origin: apache/jena

@Override
public final RecordReader<LongWritable, TripleWritable> createTripleReader() throws IOException {
  throw new IOException(this.lang.getName() + " does not support reading triples");
}

代码示例来源:origin: apache/jena

@Override
public final RecordReader<LongWritable, QuadWritable> createQuadReader() throws IOException {
  throw new IOException(this.lang.getName() + " does not support reading quads");
}

代码示例来源:origin: org.apache.jena/jena-elephas-io

@Override
public final RecordReader<LongWritable, QuadWritable> createQuadReader() throws IOException {
  throw new IOException(this.lang.getName() + " does not support reading quads");
}

代码示例来源:origin: AtomGraph/Core

public Model write(Model model, OutputStream os, Lang lang, String baseURI)
{
  if (model == null) throw new IllegalArgumentException("Model must be not null");
  if (os == null) throw new IllegalArgumentException("OutputStream must be not null");
  if (lang == null) throw new IllegalArgumentException("Lang must be not null");
  String syntax = lang.getName();
  if (log.isDebugEnabled()) log.debug("Syntax used to write Model: {}", syntax);
  
  return model.write(os, syntax);
}

代码示例来源:origin: apache/jena

@Override
protected RecordWriter<TKey, TripleWritable> getRecordWriter(Writer writer, Configuration config, Path outputPath) throws IOException {
  Lang lang = RDFLanguages.filenameToLang(outputPath.getName());
  if (lang == null)
    throw new IOException("There is no registered RDF language for the output file " + outputPath.toString());
  
  if (!RDFLanguages.isTriples(lang)) throw new IOException(
      lang.getName()
      + " is not a RDF triples format, perhaps you wanted QuadsOutputFormat or TriplesOrQuadsOutputFormat instead?");
  
  // This will throw an appropriate error if the language does not support writing triples
  return HadoopRdfIORegistry.<TKey>createTripleWriter(lang, writer, config);
}

代码示例来源:origin: org.apache.jena/jena-elephas-io

@Override
protected RecordWriter<TKey, TripleWritable> getRecordWriter(Writer writer, Configuration config, Path outputPath) throws IOException {
  Lang lang = RDFLanguages.filenameToLang(outputPath.getName());
  if (lang == null)
    throw new IOException("There is no registered RDF language for the output file " + outputPath.toString());
  
  if (!RDFLanguages.isTriples(lang)) throw new IOException(
      lang.getName()
      + " is not a RDF triples format, perhaps you wanted QuadsOutputFormat or TriplesOrQuadsOutputFormat instead?");
  
  // This will throw an appropriate error if the language does not support writing triples
  return HadoopRdfIORegistry.<TKey>createTripleWriter(lang, writer, config);
}

代码示例来源:origin: DeFacto/DeFacto

public static void main(final String[] a) {
 DefactoModel dm;
 dm = DummyData.getTestModel();
 dm.model.write(System.out, Lang.TURTLE.getName());
 dm = DummyData.getTestModel2();
 dm.model.write(System.out, Lang.TURTLE.getName());
 dm = DummyData.getEinsteinModel();
 dm.model.write(System.out, Lang.TURTLE.getName());
}

代码示例来源:origin: at.researchstudio.sat/won-matcher-service

public NeedEvent(String uri, String wonNodeUri, TYPE eventType, long crawlDate, String resource, Lang format) {
 this.uri = uri;
 this.wonNodeUri = wonNodeUri;
 this.eventType = eventType;
 this.crawlDate = crawlDate;
 serializedNeedResource = resource;
 serializationLangName = format.getName();
 serializationLangContentType = format.getContentType().getContentType();
}

代码示例来源:origin: SmartDataAnalytics/DL-Learner

@Override
protected void loadSchema() {
  try(InputStream is = new URL(ONTOLOGY_URL).openStream()){
    schema.read(is, null, Lang.RDFXML.getName());
  } catch (IOException e) {
    e.printStackTrace();
  }
}

代码示例来源:origin: apache/jena

@Parameters(name = "{index}: {0}") 
public static Collection<Object[]> data() { 
  Lang[] langs = { SPARQLResultSetXML
          , SPARQLResultSetJSON
          , SPARQLResultSetCSV
          , SPARQLResultSetTSV
  } ;
  
  List<Object[]> x = new ArrayList<>() ;
  for ( Lang lang : langs ) {
    x.add(new Object[]{ "test:"+lang.getName(), lang } ) ;
  }
  return x ;                                
}

代码示例来源:origin: at.researchstudio.sat/won-matcher-service

public NeedEvent(String uri, String wonNodeUri, TYPE eventType, long crawlDate, Dataset ds) {
 this.uri = uri;
 this.wonNodeUri = wonNodeUri;
 this.eventType = eventType;
 this.crawlDate = crawlDate;
 StringWriter sw = new StringWriter();
 RDFDataMgr.write(sw, ds, RDFFormat.TRIG.getLang());
 serializedNeedResource = sw.toString();
 serializationLangName = RDFFormat.TRIG.getLang().getName();
 serializationLangContentType = RDFFormat.TRIG.getLang().getContentType().getContentType();
}

代码示例来源:origin: SmartDataAnalytics/DL-Learner

@Override
protected void loadSchema() {
  try(InputStream is = new BZip2CompressorInputStream(new URL(DBPEDIA_ONTOLOGY_URL).openStream())){
    schema.read(is, null, Lang.RDFXML.getName());
  } catch (IOException e) {
    e.printStackTrace();
  }
}

代码示例来源:origin: apache/jena

@Test
public void testGet()
{
  for (Lang l : RDFLanguages.getRegisteredLanguages() )
  {
    Assert.assertNotNull( l+" can not be parsed by name", RDFLanguages.shortnameToLang( l.getName())  );
  }
}

代码示例来源:origin: com.github.jsonld-java/jsonld-java-jena

@Test
public void jenaSystem_basic_1() {
  assertEquals("name", "JSON-LD", JenaJSONLD.JSONLD.getName());
  assertEquals("content-type", "application/ld+json", JenaJSONLD.JSONLD.getContentType()
      .getContentType());
}

相关文章