當前位置: 首頁>>代碼示例>>Java>>正文


Java RDFFormat.N3屬性代碼示例

本文整理匯總了Java中org.openrdf.rio.RDFFormat.N3屬性的典型用法代碼示例。如果您正苦於以下問題:Java RDFFormat.N3屬性的具體用法?Java RDFFormat.N3怎麽用?Java RDFFormat.N3使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在org.openrdf.rio.RDFFormat的用法示例。


在下文中一共展示了RDFFormat.N3屬性的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getRequestedAcceptHeader

public static RDFFormat getRequestedAcceptHeader(String contentType) {        
    RDFFormat requesetedContentType = null; 
    if (contentType == null || contentType.isEmpty()) {
        requesetedContentType = RDFFormat.TURTLE;
    }
    else if (contentType.contentEquals(
            RDFFormat.TURTLE.getDefaultMIMEType()) ||         
            contentType.contains(MediaType.ALL_VALUE)) {
        requesetedContentType = RDFFormat.TURTLE;
    }
    else if (contentType.contentEquals(
            RDFFormat.JSONLD.getDefaultMIMEType())) {
        requesetedContentType = RDFFormat.JSONLD;
    }
    else if (contentType.contentEquals(
            RDFFormat.N3.getDefaultMIMEType())) {
        requesetedContentType = RDFFormat.N3;
    }
    else if (contentType.contentEquals(
            RDFFormat.RDFXML.getDefaultMIMEType())) {
        requesetedContentType = RDFFormat.RDFXML;
    }
    return requesetedContentType;
}
 
開發者ID:DTL-FAIRData,項目名稱:ODEX-FAIRDataPoint,代碼行數:24,代碼來源:HttpHeadersUtils.java

示例2: parseFormat

/** Converts a command-line RDF type name into the appropriate Sesame type value. */
private static RDFFormat parseFormat(String format) {
    switch(format) {
        case "binary": return RDFFormat.BINARY;
        case "json-ld": return RDFFormat.JSONLD;
        case "n3": return RDFFormat.N3;
        case "n-quads": return  RDFFormat.NQUADS;
        case "n-triples": return RDFFormat.NTRIPLES;
        case "rdf-a": return RDFFormat.RDFA;
        case "rdf-json": return RDFFormat.RDFJSON;
        case "rdf-xml": return RDFFormat.RDFXML;
        case "trig": return RDFFormat.TRIG;
        case "trix": return RDFFormat.TRIX;
        case "turtle": return RDFFormat.TURTLE;
    }
    return null;
}
 
開發者ID:abcoates,項目名稱:sesame-serializer,代碼行數:17,代碼來源:RDFFormatter.java

示例3: storeInRepo

public void storeInRepo(String src, String baseURI, String context, String format,
    Boolean inference) throws RDFParseException, RepositoryException, IOException,
    RDFHandlerException, InvalidDatasetFormatFault {
  RDFFormat realFormat = null;

  GeosparqlRDFHandlerBase.ENABLE_INFERENCE = inference;

  if ((baseURI != null) && (baseURI.equals(""))) {
    baseURI = null;
  }

  URI uriContext;

  if ((context == null) || (context.equals(""))) {
    uriContext = null;

  } else {
    ValueFactory f = repo.getValueFactory();
    uriContext = f.createURI(context);
  }

  if (format.equalsIgnoreCase("N3") || format.equals(RDFFormat.N3.getName())) {
    realFormat = RDFFormat.N3;

  } else if (format.equalsIgnoreCase("NTRIPLES") || format.equals(RDFFormat.NTRIPLES.getName())) {
    realFormat = RDFFormat.NTRIPLES;

  } else if (format.equalsIgnoreCase("RDFXML") || format.equals(RDFFormat.RDFXML.getName())) {
    realFormat = RDFFormat.RDFXML;

  } else if (format.equalsIgnoreCase("TURTLE") || format.equals(RDFFormat.TURTLE.getName())) {
    realFormat = RDFFormat.TURTLE;

  } else {
    throw new InvalidDatasetFormatFault();
  }

  try {
    URL source = new URL(src);
    storeURL(source, baseURI, uriContext, realFormat);

  } catch (MalformedURLException e) {

    URL fromClasspath = getClass().getResource(src);
    if (fromClasspath != null) {
      storeURL(fromClasspath, baseURI, uriContext, realFormat);

    } else {
      File file = new File(src);
      if (file.exists()) {
        storeURL(new URL("file://" + src), baseURI, uriContext, realFormat);

      } else {
        logger.info("File \"{}\" does not exist. Trying reading as String.", src);
        storeString((String) src, baseURI, uriContext, realFormat);
      }
    }
  }
}
 
開發者ID:esarbanis,項目名稱:strabon,代碼行數:59,代碼來源:Strabon.java


注:本文中的org.openrdf.rio.RDFFormat.N3屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。