我使用幾個不同的三重商店,並在代碼R和斯卡拉。我想我看到一些差異:三重奏如何決定是否添加「背景」三元組?
- 三重商店是否包含明確加載的三元組以外的三元組。
- 可能會添加這些「背景」三元組的點。
是否有支持詞彙表是否需要添加的一般規則,而與實現技術無關?
在[R使用耶拿,通過rrdf,我通常只看到我裝:
library(rrdf)
turtle.input.string <-
"PREFIX prefix: <http://example.com/>
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix:subject rdf:type prefix:object"
jena.model <-
fromString.rdf(rdfContent = turtle.input.string, format = "TURTLE")
model.string <- asString.rdf(jena.model, format = "TURTLE")
cat(model.string)
這給:
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix prefix: <http://example.com/> .
prefix:subject a prefix:object .
但有時候tr從即可得到的數據RDF和RDFS似乎在我之後添加或刪除三元組時出現。這就是最「困擾」我的,但我現在很難找到一個例子。如果沒人知道我的意思,我今天晚些時候會挖掘一些東西。
當我使用Blazegraph在斯卡拉,通過OpenRDF芝麻庫,我想我總是得到RDF,RDFS和OWL 「免費」
import java.util.Properties
import org.openrdf.query.QueryLanguage
import org.openrdf.rio._
import com.bigdata.journal._
import com.bigdata.rdf.sail._
object InjectionTest {
val jnl_fn = "sparql_tests.jnl"
def main(args: Array[String]): Unit = {
val props = new Properties()
props.put(Options.BUFFER_MODE, BufferMode.DiskRW)
props.put(Options.FILE, jnl_fn)
val sail = new BigdataSail(props)
val repo = new BigdataSailRepository(sail)
repo.initialize()
val cxn = repo.getConnection()
val resultStream = new java.io.ByteArrayOutputStream
val resultWriter = Rio.createWriter(RDFFormat.TURTLE, resultStream)
val ConstructString = "construct {?s ?p ?o} where {?s ?p ?o}"
cxn.prepareGraphQuery(QueryLanguage.SPARQL, ConstructString).evaluate(resultWriter)
var resString = resultStream.toString()
println(resString)
}
}
即使不添加任何三元組,也可以使用construct
或tput的包括這樣的塊:
rdfs:isDefinedBy rdfs:domain rdfs:Resource ;
rdfs:range rdfs:Resource ;
rdfs:subPropertyOf rdfs:isDefinedBy , rdfs:seeAlso .
我只能回答耶拿。如果您在RDFS配置文件中使用OntModel,則默認情況下將添加RDF和RDFS詞彙以及公理三元組。請參閱https://www.w3.org/TR/rdf11-mt/#rdfs-interpretations – AKSW
謝謝,這是有道理的。 rrdf是Jena上的一個包裝器,並且它提供**創建** ** **新**模型作爲**本體**的選項。在從字符串或文件加載三元組時,它不會給出該選項。你能想到在事實之後會注入RDF和RDFS詞彙的任何情況嗎? –