使用以下查询:
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX uni: <http://localhost/SemanticSearch/semanticsearch.owl#>
SELECT
DISTINCT *
WHERE {
?uri uni:altLabel "5"^^xsd:integer.
?uri rdf:type ?type
}
Run Code Online (Sandbox Code Playgroud)
也返回其具有的URI altLabel与xsd:decimal5.x的我真的需要它来只返回?uri具有altLabel的xsd:integer.反正有没有实现这个目标?
我有一个数组$标签,我打印使用:
foreach($tags as $t) {
echo $t['token'] . "/" . $t['tag'] . " ";
}
Run Code Online (Sandbox Code Playgroud)
我怎样才能将这个$标签传递给Java servlet,所以在Java程序中我可以像在PHP脚本中一样使用foreach和$t['token']和$t['tag']?
我假设必须使用POST方法完成,是否也可以使用GET?
更新
了json_array:
$js_array = json_encode($tags);
echo "var javascript_array = ". $js_array . ";\n";
Run Code Online (Sandbox Code Playgroud)
哪个回报:
var javascript_array = [{"token":"test","tag":"NN"},{"token":"1","tag":"NN"}];
Run Code Online (Sandbox Code Playgroud)
我试图通过使用以下方法将其传递给servlet:
<script src="http://code.jquery.com/jquery-1.10.1.min.js">
$( document ).ready(function() {
alert('ok');
$.ajax({
url : "http://localhost:8080/first/SPARQL",
type: "POST",
data: $js_array,
dataType: "json",
async: false,
success: function (){
alert( "succes");},
error: function(){
alert("false");
}
});
});
</script>
Run Code Online (Sandbox Code Playgroud)
但是,它既不返回"成功"或"假".它显示"确定"警报.PS我正在通过Eclipse和Tomcat 8运行java servlet.php文件在我的Wamp localhost上.我可以在浏览器中访问该URL.
此外,似乎我不能在我用PHP制作的javascript中使用$ js_array,它说它没有设置. …
我正在尝试使用如下查询将数百行插入表中:
Insert INTO tableX (column1, colum2)
VALUES
((SELECT sysID FROM tableY where ID = var1), 1)
((SELECT sysID FROM tableY where ID = var2), 1)
et cetera
Run Code Online (Sandbox Code Playgroud)
现在让我们说var88不存在,它将返回NULL作为sysID,但是我不能在column1中插入NULL,所以我得到一个错误,整个插入查询将被终止.有没有办法取消整个终止,只是跳过sysID = NULL的行?我确信我可以通过首先进行正确的选择,过滤掉NULL行然后插入,然后我想知道是否还有其他方法来做到这一点.
bulkinsert ×1
java ×1
javascript ×1
jena ×1
jquery ×1
owl ×1
pellet ×1
php ×1
rdf ×1
servlets ×1
sparql ×1
sql ×1
sql-insert ×1
sql-server ×1