• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java UnsupportedRDFormatException类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.openrdf.rio.UnsupportedRDFormatException的典型用法代码示例。如果您正苦于以下问题:Java UnsupportedRDFormatException类的具体用法?Java UnsupportedRDFormatException怎么用?Java UnsupportedRDFormatException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



UnsupportedRDFormatException类属于org.openrdf.rio包,在下文中一共展示了UnsupportedRDFormatException类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: data

import org.openrdf.rio.UnsupportedRDFormatException; //导入依赖的package包/类
@Parameters(name = "{0}")
public static Collection<Object[]> data() {
    Collection<Object[]> result = new ArrayList<>();
    for (RDFFormat nextParserFormat : RDFParserRegistry.getInstance().getKeys()) {
        try {
            // Try to create a writer, as not all formats (RDFa for example) have writers,
            // and we can't automatically test those formats like this
            OutputStream out = new ByteArrayOutputStream();
            Rio.createWriter(nextParserFormat, out);
            // If the writer creation did not throw an exception, add it to the list
            result.add(new Object[]{nextParserFormat});
        } catch(UnsupportedRDFormatException e) {
            // Ignore to drop this format from the list
        }
    }
    assertFalse("No RDFFormats found with RDFParser implementations on classpath", result.isEmpty());
    return result;
}
 
开发者ID:tkurz,项目名称:sesame-vocab-builder,代码行数:19,代码来源:VocabBuilderTest.java


示例2: test_invalidFile

import org.openrdf.rio.UnsupportedRDFormatException; //导入依赖的package包/类
@Test(expected = UnsupportedRDFormatException.class)
public void test_invalidFile() throws Exception {
    try(final Producer<?, VisibilityStatement> producer =
            KafkaTestUtil.makeProducer(rule, StringSerializer.class, VisibilityStatementSerializer.class)) {
        final KafkaLoadStatements command = new KafkaLoadStatements(rule.getKafkaTopicName(), producer);
        command.fromFile(INVALID, "a|b|c");
    }
}
 
开发者ID:apache,项目名称:incubator-rya,代码行数:9,代码来源:KafkaLoadStatementsIT.java


示例3: main

import org.openrdf.rio.UnsupportedRDFormatException; //导入依赖的package包/类
public static void main(String[] args) throws RDFParseException, UnsupportedRDFormatException, IOException,
        RepositoryException, ReferringExpressionException, RDFHandlerException {

    Options options = new Options();
    new JCommander(options, args);

    FileInputStream in = new FileInputStream(options.rdf);

    Model m = Rio.parse(in, "http://localhost/", RDFFormat.NTRIPLES);

    ReferringExpressionAlgorithm algorithm = null;
    if (options.algorithm.equals(DaleReiterAlgorithm.class.getName())) {
        algorithm = new DaleReiterAlgorithm(TypePriorities.dbPediaPriorities, TypePriorities.dbPediaIgnored);
        if (options.verbose)
            ((ch.qos.logback.classic.Logger) DaleReiterAlgorithm.logger).setLevel(Level.DEBUG);
    } else if (options.algorithm.equals(GardentAlgorithm.class.getName())) {
        algorithm = new GardentAlgorithm(TypePriorities.dbPediaPriorities, TypePriorities.dbPediaIgnored);
        if (options.verbose)
            ((ch.qos.logback.classic.Logger) GardentAlgorithm.logger).setLevel(Level.DEBUG);
    } else if (options.algorithm.equals(GraphAlgorithm.class.getName())) {
        algorithm = new GraphAlgorithm(TypePriorities.dbPediaPriorities, TypePriorities.dbPediaIgnored);
        if (options.verbose)
            ((ch.qos.logback.classic.Logger) GraphAlgorithm.logger).setLevel(Level.DEBUG);
    } else {
        System.err.println("Unknown algorithm '" + options.algorithm + "'");
        System.exit(-1);
    }

    Repository rep = new SailRepository(new MemoryStore());
    rep.initialize();
    ValueFactory f = rep.getValueFactory();

    List<URI> confusors = new ArrayList<URI>(options.confusors.size());
    for (String confusor : options.confusors)
        confusors.add(f.createURI(confusor));

    RepositoryConnection conn = rep.getConnection();
    try {
        conn.add(m);

        URI referent = f.createURI(options.referent);

        if (options.type != null)
            conn.add(referent, RDF.TYPE, f.createURI(options.type));

        ReferringExpression r = algorithm.resolve(referent, confusors, conn);
        System.out.println(r);
    } finally {
        conn.close();
    }

}
 
开发者ID:DrDub,项目名称:Alusivo,代码行数:53,代码来源:Main.java


示例4: RdfWriter

import org.openrdf.rio.UnsupportedRDFormatException; //导入依赖的package包/类
public RdfWriter(RDFFormat format, OutputStream output)
		throws UnsupportedRDFormatException {
	this.writer = Rio.createWriter(format, output);
}
 
开发者ID:Wikidata,项目名称:Wikidata-Toolkit,代码行数:5,代码来源:RdfWriter.java


示例5: rdfStringMatches

import org.openrdf.rio.UnsupportedRDFormatException; //导入依赖的package包/类
/**
 * Wrap a {@link org.apache.marmotta.commons.sesame.test.base.AbstractRepositoryConnectionMatcher} with a {@link org.apache.marmotta.commons.sesame.test.base.RdfStringMatcher},
 * to match the provided matcher against an serialized RDF-String.
 *
 * @param mimeType the MimeType used to guess the RDFFormat for de-serializing the RDF
 * @param baseUri  the baseUri used for de-serializing the RDF
 * @param matchers the Matchers to wrap
 * @see Rio#getParserFormatForMIMEType(String)
 * @see org.apache.marmotta.commons.sesame.test.base.RdfStringMatcher#wrap(org.openrdf.rio.RDFFormat, String, org.hamcrest.Matcher)
 */
@SafeVarargs
public static <T extends String, V extends RepositoryConnection> Matcher<T> rdfStringMatches(String mimeType, String baseUri, Matcher<V>... matchers) {
    final RDFFormat format = Rio.getParserFormatForMIMEType(mimeType);
    if (format == null) throw new UnsupportedRDFormatException(mimeType);
    return RdfStringMatcher.wrap(format, baseUri, CoreMatchers.allOf(matchers));
}
 
开发者ID:apache,项目名称:marmotta,代码行数:17,代码来源:SesameMatchers.java



注:本文中的org.openrdf.rio.UnsupportedRDFormatException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ContextImage类代码示例发布时间:2022-05-22
下一篇:
Java ContainerManagerImpl类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap