好吧假设我有5个数据类型属性,其中整数作为值.这些属性声明属于"WWS"类的个人.这个班有4个人.但是这些个体中只存在一些数据类型属性.如何查询此类中满足值5的个体.我希望变量仅显示其属性满足的个体,其余部分不应出现.
我希望这更清楚!
谢谢!
数据:
datatype properties (range:integers): #greaterthantoc #lessthantoc #lowerlimtoc #upperlimtoc #equalstoc
individuals: #ww1, #ww2, #ww3 , #ww4 belong to class #WWS
#ww1 has #greaterthantoc "0"^^xsd:integer
#ww2 has #lessthantoc "5"^^xsd:integer
#ww3 has #greaterthantoc "5"^^xsd:integer
#ww4 has #lowerlimtoc "9"^^xsd:integer and #upperlimtoc "10"^^xsd:integer
Conditions for each property (filter?):
#greaterthantoc <= "a number"
#lessthantoc >= "a number"
#lowerlimtoc <= "a number" && #upperlimtoc >= "a number"
#equalstoc = "a number"
Run Code Online (Sandbox Code Playgroud)
结果应该是满足其中一些条件的WWS个体.例如,当number为4时,结果应为WW1和WW2
我怀疑我的情况需要这样的东西,但它仍然不会返回结果:
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX …
Run Code Online (Sandbox Code Playgroud) 我要做的是创建一个接受和识别数字间隔的数据类型属性.例如,假设我有"温度"属性.在本体中,我想创建2个子属性"hot"和"cold".炎热的温度是20-30,冷的是0-19.我现在正在做的是将一些属性设置为lowerlim和upperlim.但有没有更方便的方式直接通过属性表达间隔?因此,当我查询例如"23"时,它会识别出它的"热".有小费吗?
先感谢您
我正在尝试编辑matlab文件并在某些特定行中替换一些编码部分init.但是,使用下面的格式进行更改它根本不会更改行上下文.(它将打印相同的旧行).知道我做错了什么吗?'replaceAll'不适合用行中的其他单词替换某些单词?
提前致谢.
try {
PrintWriter out = new PrintWriter(new FileWriter(filenew, true));
Scanner scanner = new Scanner(file);
while (scanner.hasNextLine()) {
String line = scanner.nextLine();
if (line.contains("stream.Values(strmatch('Test',stream.Components,'exact'))") {
String newline = line.replaceAll("stream.Values(strmatch('Test',stream.Components,'exact'))", "New Data");
out.println(newline);
System.out.println(newline);
} else {
out.write(line);
out.write("\n");
}
} // while loop
out.flush();
out.close();
scanner.close();
} catch (IOException e) {
e.printStackTrace();
}
Run Code Online (Sandbox Code Playgroud) protege ×2
java ×1
ontology ×1
owl ×1
printwriter ×1
properties ×1
rdf ×1
replaceall ×1
semantic-web ×1
sparql ×1