本文整理汇总了Java中org.openrdf.rio.RDFParserFactory类的典型用法代码示例。如果您正苦于以下问题:Java RDFParserFactory类的具体用法?Java RDFParserFactory怎么用?Java RDFParserFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RDFParserFactory类属于org.openrdf.rio包,在下文中一共展示了RDFParserFactory类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: setUp
import org.openrdf.rio.RDFParserFactory; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
initRepository();
final RDFParserFactory factory = new SesameJSONLDParserFactory();
this.parser = factory.getParser();
parser.setRDFHandler(new StatementCopyingHandler(connection));
this.objectMapper = new ObjectMapper();
objectMapper.registerModule(new JsonLdModule());
}
开发者ID:kbss-cvut,项目名称:jb4jsonld-jackson,代码行数:11,代码来源:JsonLdSerializationTest.java
示例2: testLoadService
import org.openrdf.rio.RDFParserFactory; //导入依赖的package包/类
@Test
public final void testLoadService() throws ClassNotFoundException, IOException{
ServiceLoader<RDFParserFactory> loader = ServiceLoader.load(RDFParserFactory.class);
for(RDFParserFactory rpf : loader){
System.out.println(rpf);
}
}
开发者ID:Data2Semantics,项目名称:ducktape,代码行数:8,代码来源:TestResourceFinderForServices.java
示例3: getParser
import org.openrdf.rio.RDFParserFactory; //导入依赖的package包/类
public static RDFParser getParser(String address, String rdfFormatName) throws BridgeDBException{
RDFParserRegistry reg = RDFParserRegistry.getInstance();
RDFFormat format = null;
if (rdfFormatName == null || rdfFormatName.isEmpty()){
if (address.endsWith(".gz")){
address = address.substring(0, address.length()-3);
}
if (address.endsWith(".n3")){
address = "try.ttl";
}
FileFormat fileFormat = reg.getFileFormatForFileName(address);
if (fileFormat == null || !(fileFormat instanceof RDFFormat)){
//added bridgeDB/OPS specific extension here if required.
logger.warn("OpenRDF does not know the RDF Format for " + address);
logger.warn("Using the default format " + DEFAULT_PARSER);
return DEFAULT_PARSER;
}
format = (RDFFormat)fileFormat;
} else {
for (RDFFormat rdfFormat:RDFFormat.values()){
if (rdfFormat.getName().equalsIgnoreCase(rdfFormatName)){
format = rdfFormat;
}
if (format == null){
throw new BridgeDBException("No RdfFormat with name " + rdfFormatName + " known");
}
}
}
RDFParserFactory factory = reg.get(format);
return factory.getParser();
}
开发者ID:bridgedb,项目名称:BridgeDb,代码行数:32,代码来源:RdfParser.java
注:本文中的org.openrdf.rio.RDFParserFactory类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论