微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

我想在以下耶拿模型中查询资源Massambala我应该怎么做

如何解决我想在以下耶拿模型中查询资源Massambala我应该怎么做

我正在使用Apache Jena,我想从我的RDF数据中查询特定资源。现在,根据下面的RDF文档,我想查询资源Massambala并将其保存到文件中。

所以基本上,本体和资源应该保存到文件

我应该怎么做?

提前谢谢

以下是我正在研究的模型

    <rdf:RDF
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-Syntax-ns#"
    xmlns:owl="http://www.w3.org/2002/07/owl#"
    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
    xmlns:dados="http://localhost:8080/dados/#"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema#">

  <owl:Class rdf:about="http://localhost:8080/dados/#Fruteiras">
    <rdfs:subClassOf>
      <owl:Class rdf:about="http://localhost:8080/dados/#Producto"/>
    </rdfs:subClassOf>
  </owl:Class>
  <owl:Class rdf:about="http://localhost:8080/dados/#Horticulas">
    <rdfs:subClassOf rdf:resource="http://localhost:8080/dados/#Producto"/>
  </owl:Class>
  <owl:Class rdf:about="http://localhost:8080/dados/#Cereais">
    <rdfs:subClassOf rdf:resource="http://localhost:8080/dados/#Producto"/>
  </owl:Class>
  <owl:Class rdf:about="http://localhost:8080/dados/#Raizes">
    <rdfs:subClassOf rdf:resource="http://localhost:8080/dados/#Producto"/>
  </owl:Class>
  <owl:Class rdf:about="http://localhost:8080/dados/#LeguminosaSEOleaginosas">
    <rdfs:subClassOf rdf:resource="http://localhost:8080/dados/#Producto"/>
  </owl:Class>
  <owl:DatatypeProperty rdf:about="http://localhost:8080/dados/#areaColhida">
    <rdfs:range>
      <xsd:double rdf:about="http://localhost:8080/dados/#hectares">
        <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/>
      </xsd:double>
    </rdfs:range>
    <rdfs:domain rdf:resource="http://localhost:8080/dados/#Producto"/>
  </owl:DatatypeProperty>
  <owl:DatatypeProperty rdf:about="http://localhost:8080/dados/#ano">
    <rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#date"/>
    <rdfs:domain rdf:resource="http://localhost:8080/dados/#Producto"/>
  </owl:DatatypeProperty>
  <owl:DatatypeProperty rdf:about="http://localhost:8080/dados/#producao">
    <rdfs:range>
      <xsd:double rdf:about="http://localhost:8080/dados/#toneladas">
        <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/>
      </xsd:double>
    </rdfs:range>
    <rdfs:domain rdf:resource="http://localhost:8080/dados/#Producto"/>
  </owl:DatatypeProperty>
  <owl:DatatypeProperty rdf:about="http://localhost:8080/dados/#areaSemeada">
    <rdfs:range rdf:resource="http://localhost:8080/dados/#hectares"/>
    <rdfs:domain rdf:resource="http://localhost:8080/dados/#Producto"/>
  </owl:DatatypeProperty>
  <owl:DatatypeProperty rdf:about="http://localhost:8080/dados/#produtividade">
    <rdfs:range>
      <xsd:double rdf:about="http://localhost:8080/dados/#kilogramasPorHectares">
        <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/>
      </xsd:double>
    </rdfs:range>
    <rdfs:domain rdf:resource="http://localhost:8080/dados/#Producto"/>
  </owl:DatatypeProperty>

  <dados:Cereais rdf:about="http://localhost:8080/dados/#Massambala">
    <dados:ano>2017/2018</dados:ano>
    <dados:produtividade>296</dados:produtividade>
    <dados:producao>39363</dados:producao>
    <dados:areaColhida>133148</dados:areaColhida>
    <dados:areaSemeada>145161</dados:areaSemeada>
  </dados:Cereais>

  <dados:Raizes rdf:about="http://localhost:8080/dados/#Batata_doce">
    <dados:ano>2017/2018</dados:ano>
    <dados:produtividade>9663</dados:produtividade>
    <dados:producao>1545326</dados:producao>
    <dados:areaColhida>159922</dados:areaColhida>
    <owl:sameAs rdf:resource="http://dbpedia.org/page/Sweet_potato"/>
    <owl:sameAs rdf:resource="http://pt.dbpedia.org/resource/Batata-doce"/>
    <owl:sameAs rdf:resource="https://pt.wikipedia.org/wiki/Batata-doce"/>
    <dados:areaSemeada>165319</dados:areaSemeada>
  </dados:Raizes>
</rdf:RDF>

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。