<AnnotationAssertion>
<AnnotationProperty abbreviatedIRI="rdfs:label"/>
<AbbreviatedIRI>atc:A02BX02</AbbreviatedIRI>
<Literal xml:lang="no" datatypeIRI="&rdf;PlainLiteral">Sukralfat</Literal>
</AnnotationAssertion>
<AnnotationAssertion>
<AnnotationProperty abbreviatedIRI="rdfs:label"/>
<AbbreviatedIRI>atc:A02BX02</AbbreviatedIRI>
<Literal xml:lang="no" datatypeIRI="&rdf;PlainLiteral">antepsin</Literal>
</AnnotationAssertion>
<AnnotationAssertion>
<AnnotationProperty abbreviatedIRI="rdfs:label"/>
<AbbreviatedIRI>atc:A02BX02</AbbreviatedIRI>
<Literal datatypeIRI="&xsd;string">sucralfate</Literal>
</AnnotationAssertion>
<AnnotationAssertion>
<AnnotationProperty abbreviatedIRI="rdfs:label"/>
<AbbreviatedIRI>atc:A02BX02</AbbreviatedIRI>
<Literal xml:lang="no" datatypeIRI="&rdf;PlainLiteral">sukralfat</Literal>
</AnnotationAssertion>
<?xml version="1.0"?>
<!DOCTYPE Ontology [
<!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" >
<!ENTITY xml "http://www.w3.org/XML/1998/namespace" >
<!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" >
<!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" >
]>
<Ontology xmlns="http://www.w3.org/2002/07/owl#"
xml:base="http://www.ebi.ac.uk/Rebholz-srv/atc/public/ontologies/atc.owl"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:xml="http://www.w3.org/XML/1998/namespace"
ontologyIRI="http://www.ebi.ac.uk/Rebholz-srv/atc/public/ontologies/atc.owl">
<Prefix name="" IRI="http://www.ebi.ac.uk/Rebholz-srv/atc/public/ontologies/atc.owl#"/>
<Prefix name="atc" IRI="http://www.legemiddelverket.no/Legemiddelsoek/Sider/Default.aspx#"/>
<Prefix name="owl" IRI="http://www.w3.org/2002/07/owl#"/>
<Prefix name="rdf" IRI="http://www.w3.org/1999/02/22-rdf-syntax-ns#"/>
<Prefix name="xml" IRI="http://www.w3.org/XML/1998/namespace"/>
<Prefix name="xsd" IRI="http://www.w3.org/2001/XMLSchema#"/>
<Prefix name="rdfs" IRI="http://www.w3.org/2000/01/rdf-schema#"/>
<Declaration>
<Class abbreviatedIRI="atc:J"/>
</Declaration>
<AnnotationAssertion>
<AnnotationProperty abbreviatedIRI="rdfs:label"/>
<AbbreviatedIRI>atc:J</AbbreviatedIRI>
<Literal datatypeIRI="&xsd;string">ANTIINFECTIVES FOR SYSTEMIC USE</Literal>
</AnnotationAssertion>
</Ontology>
下面是java代码:
InputStream in = FileManager.get().open(filename);
if (in == null) {
throw new IllegalArgumentException("File: " + filename + " not found");
}
model = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM);
model.read(in, null);
try {
in.close();
} catch (IOException e) {
System.err.println("Couldn't close the inputStream");
}
这有帮助吗?我真的不知道了...
我需要帮助从RDF和Jena框架中获取一些信息。我有一个RDF内容是这样的: 我如何提取值test_id_test???如果我想用SPARQL,我怎么用Jena???
我想把xml文件转换成RDF。我认为JENA GRDDL可以使用,但我不知道它是如何工作的!我没有找到任何例子!你能帮助我请开始使用这个API或显示我任何可能的解决方案!
我用一个递归函数尝试过它,它迭代语句,当语句不是文字时,它会跟随对象到达下一个节点。像这样: 但不知怎的,我用这个方法没有什么进展。非常感谢你的每一次洞察。