代码之家  ›  专栏  ›  技术社区  ›  Shreshtha Garg

Jena Riot在Jena TDB数据集中更新本体时出现异常

  •  0
  • Shreshtha Garg  · 技术社区  · 8 年前

    输入参数:modelName->保存在TDB中的namedModel 输入字符串->本体数据转换为字符串 我的代码如下:

    public void updateModel(String modelName, String inputString) {
        dataset.begin(ReadWrite.WRITE);
        try {
            Model model = dataset.getNamedModel(modelName);
            model.removeAll();
            StringReader reader = new StringReader(inputString);
            model.read(reader,null,"RDF/XML-ABBREV");
            dataset.commit();
            logger.info("dataset committed");
        } catch (Exception e) {
            logger.error("Exception in reading : " + e);
        } finally {
            dataset.end();
        }
    
    }
    

    它抛出以下错误:org。阿帕奇。杰娜。暴乱RiotException:[line:1,col:1]prolog中不允许包含内容。

    0 回复  |  直到 8 年前