- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我想要做的是从 Individual1 或一个类中获取属性列表,
从“某物”获取所有属性
结果应该是这样的(对于 Secret_Data):
| Asset_has_Confidentiality_Importance | High |
| Asset_has_Availability_Importance....| Moderate |
| Asset_has_Integrity_Importance.......| Moderate |
| Asset_threatenedBy_ThreatEvent.......| Compromise_sensitive_information |
| Asset_threatenedBy_ThreatEvent.......| Disclosure_of_sensitive_information |
| Asset_threatenedBy_ThreatEvent.......| Exploit_exposed_unauthorized_information |
| Asset_threatenedBy_ThreatEvent.......| Integrity_loss_by_corrupting_critital_data |
<owl:NamedIndividual rdf:about="&securityOntology_ITESM_UC3M;Secret_Data">
<rdf:type rdf:resource="&securityOntology_ITESM_UC3M;Data"/>
<Asset_has_Confidentiality_Importance rdf:datatype="&xsd;string">High</Asset_has_Confidentiality_Importance>
<Asset_has_Availability_Importance rdf:datatype="&xsd;string">Moderate</Asset_has_Availability_Importance>
<Asset_has_Integrity_Importance rdf:datatype="&xsd;string">Moderate</Asset_has_Integrity_Importance>
<Asset_threatenedBy_ThreatEvent rdf:resource="&securityOntology_ITESM_UC3M;Compromise_sensitive_information"/>
<Asset_threatenedBy_ThreatEvent rdf:resource="&securityOntology_ITESM_UC3M;Disclosure_of_sensitive_information"/>
<Asset_threatenedBy_ThreatEvent rdf:resource="&securityOntology_ITESM_UC3M;Exploit_exposed_unauthorized_information"/>
<Asset_threatenedBy_ThreatEvent rdf:resource="&securityOntology_ITESM_UC3M;Integrity_loss_by_corrupting_critital_data"/>
<Asset_threatenedBy_ThreatEvent rdf:resource="&securityOntology_ITESM_UC3M;Obtain_unauthorized_access"/>
</owl:NamedIndividual>
PREFIX css:<http://www.semanticweb.org/evalues/ontologies/2014/3/securityOntology_ITESM_UC3M#>
SELECT DISTINCT ?property ?value
WHERE {
css:Secret_Data ?property ?value.
}
最佳答案
回答更新的问题(关于个人的查询)
用完整的样本数据回答问题要容易得多。如果我们将您提供的数据与适当的命名空间声明捆绑在一起,我们最终会得到如下结果:
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns="http://stackoverflow.com/q/23223447/1281433/">
<owl:NamedIndividual rdf:about="http://stackoverflow.com/q/23223447/1281433/Secret_Data">
<Asset_has_Availability_Importance rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
>Moderate</Asset_has_Availability_Importance>
<rdf:type rdf:resource="http://stackoverflow.com/q/23223447/1281433/Data"/>
<Asset_threatenedBy_ThreatEvent rdf:resource="http://stackoverflow.com/q/23223447/1281433/Integrity_loss_by_corrupting_critital_data"/>
<Asset_has_Integrity_Importance rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
>Moderate</Asset_has_Integrity_Importance>
<Asset_threatenedBy_ThreatEvent rdf:resource="http://stackoverflow.com/q/23223447/1281433/Obtain_unauthorized_access"/>
<Asset_threatenedBy_ThreatEvent rdf:resource="http://stackoverflow.com/q/23223447/1281433/Disclosure_of_sensitive_information"/>
<Asset_threatenedBy_ThreatEvent rdf:resource="http://stackoverflow.com/q/23223447/1281433/Compromise_sensitive_information"/>
<Asset_has_Confidentiality_Importance rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
>High</Asset_has_Confidentiality_Importance>
<Asset_threatenedBy_ThreatEvent rdf:resource="http://stackoverflow.com/q/23223447/1281433/Exploit_exposed_unauthorized_information"/>
</owl:NamedIndividual>
</rdf:RDF>
@prefix : <http://stackoverflow.com/q/23223447/1281433/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
:Secret_Data a owl:NamedIndividual , :Data ;
:Asset_has_Availability_Importance
"Moderate"^^<http://www.w3.org/2001/XMLSchema#string> ;
:Asset_has_Confidentiality_Importance
"High"^^<http://www.w3.org/2001/XMLSchema#string> ;
:Asset_has_Integrity_Importance
"Moderate"^^<http://www.w3.org/2001/XMLSchema#string> ;
:Asset_threatenedBy_ThreatEvent
:Integrity_loss_by_corrupting_critital_data , :Obtain_unauthorized_access , :Disclosure_of_sensitive_information , :Compromise_sensitive_information , :Exploit_exposed_unauthorized_information .
prefix : <http://stackoverflow.com/q/23223447/1281433/>
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#>
select distinct ?property ?value where {
:Secret_Data ?property ?value .
}
---------------------------------------------------------------------------------------
| property | value |
=======================================================================================
| rdf:type | owl:NamedIndividual |
| :Asset_has_Availability_Importance | "Moderate"^^xsd:string |
| rdf:type | :Data |
| :Asset_threatenedBy_ThreatEvent | :Integrity_loss_by_corrupting_critital_data |
| :Asset_has_Integrity_Importance | "Moderate"^^xsd:string |
| :Asset_threatenedBy_ThreatEvent | :Obtain_unauthorized_access |
| :Asset_threatenedBy_ThreatEvent | :Disclosure_of_sensitive_information |
| :Asset_threatenedBy_ThreatEvent | :Compromise_sensitive_information |
| :Asset_has_Confidentiality_Importance | "High"^^xsd:string |
| :Asset_threatenedBy_ThreatEvent | :Exploit_exposed_unauthorized_information |
---------------------------------------------------------------------------------------
rdf:type
在那里,你可以使用
filter ?property != rdf:type
,或者如果您想排除多个属性,
filter ( ?property NOT IN ( rdf:type … ) )
:
prefix : <http://stackoverflow.com/q/23223447/1281433/>
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#>
select distinct ?property ?value where {
:Secret_Data ?property ?value .
filter ( ?property not in ( rdf:type ) )
}
---------------------------------------------------------------------------------------
| property | value |
=======================================================================================
| :Asset_has_Availability_Importance | "Moderate"^^xsd:string |
| :Asset_threatenedBy_ThreatEvent | :Integrity_loss_by_corrupting_critital_data |
| :Asset_has_Integrity_Importance | "Moderate"^^xsd:string |
| :Asset_threatenedBy_ThreatEvent | :Obtain_unauthorized_access |
| :Asset_threatenedBy_ThreatEvent | :Disclosure_of_sensitive_information |
| :Asset_threatenedBy_ThreatEvent | :Compromise_sensitive_information |
| :Asset_has_Confidentiality_Importance | "High"^^xsd:string |
| :Asset_threatenedBy_ThreatEvent | :Exploit_exposed_unauthorized_information |
---------------------------------------------------------------------------------------
| numberChapters | 1 |
| numberPages | 5 |
<owl:Class rdf:about="http://webprotege.stanford.edu/RiMIUJzVuVHCr4Ke4TkFwX">
<rdfs:label>Psicology</rdfs:label>
<rdfs:subClassOf rdf:resource="http://webprotege.stanford.edu/RDHbMG5sh4tyJ6ZoHwxLBHk"/>
<rdfs:subClassOf>
<owl:Restriction>
<owl:onProperty rdf:resource="http://webprotege.stanford.edu/R9DdxIZDrtXApiHoBJ6NmAy"/>
<owl:hasValue rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">5</owl:hasValue>
</owl:Restriction>
</rdfs:subClassOf>
<rdfs:subClassOf>
<owl:Restriction>
<owl:onProperty rdf:resource="http://webprotege.stanford.edu/R8WDOefPWzIoTChbjV31ela"/>
<owl:hasValue rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">1</owl:hasValue>
</owl:Restriction>
</rdfs:subClassOf>
</owl:Class>
<http://webprotege.stanford.edu/RiMIUJzVuVHCr4Ke4TkFwX>
a owl:Class ;
rdfs:label "Psicology" ;
rdfs:subClassOf <http://webprotege.stanford.edu/RDHbMG5sh4tyJ6ZoHwxLBHk> ;
rdfs:subClassOf [ a owl:Restriction ;
owl:hasValue 5 ;
owl:onProperty <http://webprotege.stanford.edu/R9DdxIZDrtXApiHoBJ6NmAy>
] ;
rdfs:subClassOf [ a owl:Restriction ;
owl:hasValue 1 ;
owl:onProperty <http://webprotege.stanford.edu/R8WDOefPWzIoTChbjV31ela>
prefix owl: <http://www.w3.org/2002/07/owl#>
prefix : <http://webprotege.stanford.edu/project/Bnag2Z5E4j78tB27NnLq1L#>
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
select ?property ?value where {
?class rdfs:label "Psicology" ;
rdfs:subClassOf [ owl:hasValue ?value ;
owl:onProperty [ rdfs:label ?property ] ] .
}
-------------------------
| property | value |
=========================
| "numChapters" | 1 |
| "numPages" | 5 |
-------------------------
关于SPARQL 从类或个人中获取所有属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23223447/
我正在使用 SPARQL,我想知道是否可以在 in 子句中放入 sparql?更具体地说,我需要获取对此 sparql 查询具有特定条件的实体(s1,s2)[s1 在某个字段上的聚合值大于 5] se
我们有办法在 SPARQL 中做一个不减少的累加和吗? 例如, SELECT ?p WHERE { VALUES ?p { 1 1 2 } } ORDER BY ?p 将导致 1 2 4, - 而
在这个小片段中,第二行的 a 是做什么的? CONSTRUCT { ?uri a skos:Concept ; skos:prefLabel ?prefLabel ; 我确
我写了一个 Sparql 查询。 PREFIX table: SELECT ?name ?color FROM WHERE { ?element table:group ?group. ?gro
下面的两个查询有什么区别吗? select distinct ?i where{ ?i rdf:type . FILTER EXISTS { ?i ?b.
我不太明白为什么在SPARQL中他们没有实现基本的逻辑运算符。然而,在大多数情况下,可以通过多种方式获得相同的结果。 这个问题的目的是快速引用可以替代“or”语句的可能方式。 这是我能想到的: 1)联
我的问题很简单:我有一个源my:g1,其中包含: my:a1 my:b "literal 1" 然后我有第二个源my:g2,其中包含: my:a2 my:b my:c. my:c rdfs:label
我在处理数字数据类型时遇到 SPARQL 问题。 我有一个本体 ( http://cabas.ugr.es/ontology/ugr ),我在其中定义了一对属性,表示特定性别的学生人数:
我有以下 SPARQL 查询: PREFIX rdfs: PREFIX type: PREFIX prop: SELECT * WHERE { ?person a foaf:Per
我想知道如何在sparql中表达以下问题: “请告诉我每个 child 都上麻省理工学院的 parent ” 更一般地说,我想知道查询 sparql 的限制是什么?请问数据库中有哪些类型的答案不能
我正在尝试编写一个优雅的 SPARQL,为多个可能的查询提供一个解决方案。我有多个主语和多个谓词,我想接收一个对象。单一解决方案的存在非常不确定,因此我给出了多种选择。如果我没记错的话,这可以通过以下
这是一个关于 Sparql 和 Wikidata 的问题。我想制定一个返回实例类型关系的查询,但如果它不可用,则返回其子类。我尝试过: SELECT DISTINCT ?ent_type WHER
我想做一些类似的事情 { SELECT ?page, "A" AS ?type WHERE { ?s rdfs:label "Microsoft"@en;
我正在尝试进行 SPARQL 查询,该查询返回一个变量,其中包含两个单词,由某些内容分隔。实际上,我尝试获取一个变量,如 ?πληθυσμός_population(希腊语和英语)。但是,我更喜欢与“
我想知道 SPARQL 默认情况下是否采用开放世界假设,或者这是否取决于执行 SPARQL 查询的三元组存储。 这个假设在查询中的含义是什么。 致以诚挚的问候。 最佳答案 嗯.... 我想知道这对于这
我在处理数字数据类型时遇到 SPARQL 问题。 我有一个本体 ( http://cabas.ugr.es/ontology/ugr ),我在其中定义了一对属性,表示特定性别的学生人数:
我正在玩DBPedia . 通过这个查询,我得到了所有出生在伦敦的人: SELECT ?person WHERE { ?person dbo:birthPlace :London } 但
我需要处理 SPARQL 查询。有没有人有很好的链接来学习 SPARQL 查询?我正在寻找有关 SPARQL 查询和示例语法的好文章,以便我可以快速学习。 最佳答案 Lee Feigenbaum 的
我有一个 SPARQL 查询,它在 Virtuoso SPARQL 查询编辑器中运行时提供结果,但相同的查询在 SPARQL 查询验证器中给出语法错误。问题是什么?为什么显示语法错误? PREFIX
我正在运行 sparql 查询 PREFIX rdfs: PREFIX rdfs: SELECT DISTINCT(?film_link) ?film_name ?wiki
我是一名优秀的程序员,十分优秀!