for循环可以重复3次吗?例如,
for (i=0;i<=5;i++)
Run Code Online (Sandbox Code Playgroud)
创造了这个:1,2,3,4,5.我想创建一个循环来执行此操作:1,1,1,2,2,2,3,3,3,4,4,4,5,5,5
那可能吗?
使用markLogic版本 8.0-6.3
我在使用MarkLogic插入和删除三元组
WITH <>
DELETE {}
INSERT {}
WHERE {}
Run Code Online (Sandbox Code Playgroud)
条款.
在insert子句中,有大约3000个三重模式,在运行查询时我遇到错误.
**2019年1月17日12:53:08.230说明:TaskServer:XDMP-意外:(ERR:XPST0003)意外的令牌存储器耗尽
当我将三重模式限制2043在INSERT子句中时,则没有错误.
似乎一次可以插入三元组的数量有一些限制,如果是这种情况,有任何方法可以增加限制.
这是我的示例代码.
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX xs: <http://www.w3.org/2001/XMLSchema>
PREFIX skos-mla: <http://www.mlacustom.com#>
PREFIX term: <http://www.mla.com/term/>
PREFIX name: <http://www.mla.com/name/>
PREFIX work: <http://www.mla.com/work/>
PREFIX text: <http://www.mla.com/text/>
PREFIX rindicator: <http://www.mla.com/roleindicator/>
PREFIX facet: <http://www.mla.com/facet/>
PREFIX subfacet: <http://www.mla.com/subfacet/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
WITH <thesaurus-term>
DELETE {
?termiri skos-mla:hasSRsortCode ?predicate.
?termiri skos-mla:hasSSsortCode ?predicate.
?termiri skos-mla:hasVSsortCode ?predicate.
?termiri skos-mla:hasXSsortCode ?predicate.
?termiri skos-mla:hasZSsortCode ?predicate.
} INSERT {
term:1 skos-mla:hasZSsortCode 'aaa'. …Run Code Online (Sandbox Code Playgroud) 
在neo4j快速查询窗格中,有"关系类型"和"属性键",它们在Neo4j cypher查询语法的上下文中有意义.
在SPARQL中,有没有办法区分作为属性的三元组和作为属性的三元组?
我想一些示例数据可能如下所示:
<actor12> <http://some.ontology.com/#ActedIn> <movie45> #relationship
<movie45> <http://some.ontology.com/#title> “Gone with the Wind" #property key/val
Run Code Online (Sandbox Code Playgroud) 拿这两个命名图:
# graph :yesterday
:Foo
:likes :Bar ;
:likes :Qux .
# graph :today
:Foo
:likes :Bar ;
:likes :Baz .
Run Code Online (Sandbox Code Playgroud)
现在说你想知道图表中:yesterday是否存在图表中的任何三元组:today.你怎么会ASK这个查询?
ASK
FROM NAMED :yesterday
FROM NAMED :today
{
GRAPH :yesterday {
?s ?p ?o .
...
}
}
Run Code Online (Sandbox Code Playgroud) 我有三倍:Fadi吃苹果.(subject = Fadi,谓词= eat,object = Apple).我有时间当fadi吃苹果,它的:00:00:13我有时间当fadi吃苹果,它的:00:00:50
我怎么能用时间作为属性写一个rdf-triples文件?以及如何从rdf文件中获取sparql查询请求的startTime和endTime?
我试着像这样写我的rdf:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE rdf:RDF [<!ENTITY rdf 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'>
<!ENTITY rdfs 'http://www.w3.org/2000/01/rdf-schema#'>
<!ENTITY xsd 'http://www.w3.org/2001/XMLSchema#'>]>
<rdf:RDF xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dnr="http://www.dotnetrdf.org/configuration#"
xml:base="http://www.example.org/"
xmlns:startTime="http://example.org/startTime#"
xmlns:endTime="http://example.org/endTime#">
<rdf:Description rdf:about="Fadi">
<ns:be xmlns:ns="http://example.org/" xmlns:startTime="00:00:13" xmlns:endTime="00:00:16">May</ns:be>
</rdf:Description>
</rdf:RDF>
Run Code Online (Sandbox Code Playgroud)
但是c#给了我:无效的URI:URI方案无效.
我试过这个:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE rdf:RDF [<!ENTITY rdf 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'>
<!ENTITY rdfs 'http://www.w3.org/2000/01/rdf-schema#'>
<!ENTITY xsd 'http://www.w3.org/2001/XMLSchema#'>]>
<rdf:RDF xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dnr="http://www.dotnetrdf.org/configuration#"
xml:base="http://www.example.org/">
<rdf:Description rdf:about="Fadi">
<ns:be xmlns:ns="http://example.org/" xml:startTime="00:00:13" xml:endTime="00:00:16">May</ns:be>
</rdf:Description>
</rdf:RDF>
Run Code Online (Sandbox Code Playgroud)
但我无法用sparql获得时间.
我怎么写我的rdf?!!
我应该从 RDF 文件中删除重复的三元组吗?例如,我在一个文件中有这些块:
<http://Group/row1>
vocab:regione Campania ;
vocab:nome Napoli ;
vocab:codice NA .
Run Code Online (Sandbox Code Playgroud)
和
<http://Group/row1>
vocab:nome Napoli ;
vocab:codice NA .
Run Code Online (Sandbox Code Playgroud)
第二个块中的三元组也全部出现在第一个块中。是否应该从文件中删除第二个块?
我正在尝试使用三元组来返回多个值,但我得到“无法实例化三元组类型”我尝试了多种方法但没有任何效果。什么是正确的语法?
import org.apache.commons.lang3.tuple.Triple;
private static Triple<String, String, String> test() {
Triple<String, String, String> triple = new Triple<>();
...
return triple;
}
Run Code Online (Sandbox Code Playgroud) triples ×7
sparql ×4
rdf ×3
attributes ×1
duplicates ×1
for-loop ×1
java ×1
javascript ×1
linked-data ×1
loops ×1
marklogic ×1
named-graphs ×1
rdfs ×1
semantic-web ×1
semantics ×1