本体的SPARQL查询

本体的SPARQL查询,sparql,Sparql,我需要使用SPARQL获得本体中个人的限制值。例如,以下代码属于我的本体。我必须根据owl:NamedIndividual获得最小值(0.0)和最大值(0.5)。 当我运行以下代码时: 选择ind?min?max 哪里 { ?ind-owl:intersectionOf([owl:somevalues from[owl:withRestrictions([xsd:minInclusive?min])]][owl:somevalues from[owl:withRestrictions([xsd

我需要使用SPARQL获得本体中个人的限制值。例如,以下代码属于我的本体。我必须根据owl:NamedIndividual获得最小值(0.0)和最大值(0.5)。 当我运行以下代码时:

选择ind?min?max
哪里
{ 
?ind-owl:intersectionOf([owl:somevalues from[owl:withRestrictions([xsd:minInclusive?min])]][owl:somevalues from[owl:withRestrictions([xsd:maxInclusive?max])]))
}

我只得到以下结果

我需要通过根据个体筛选得到最小值和最大值,并如下所示列出它们

我该怎么做

谢谢你的帮助

<owl:NamedIndividual rdf:about="http://www.opendatainagriculture.com/ontologies/hazelnutontology#Flat">
    <rdf:type rdf:resource="http://www.opendatainagriculture.com/ontologies/hazelnutontology#ShapeOfNutApex"/>
    <rdf:type rdf:resource="http://www.opendatainagriculture.com/ontologies/hazelnutontology#Topography"/>
    <rdf:type>
        <owl:Class>
            <owl:intersectionOf rdf:parseType="Collection">
                <owl:Restriction>
                    <owl:onProperty rdf:resource="http://www.opendatainagriculture.com/ontologies/hazelnutontology#hasPercentegeValue"/>
                    <owl:someValuesFrom>
                        <rdfs:Datatype>
                            <owl:onDatatype rdf:resource="http://www.w3.org/2001/XMLSchema#double"/>
                            <owl:withRestrictions rdf:parseType="Collection">
                                <rdf:Description>
                                    <xsd:minInclusive rdf:datatype="http://www.w3.org/2001/XMLSchema#double">0.0</xsd:minInclusive>
                                </rdf:Description>
                            </owl:withRestrictions>
                        </rdfs:Datatype>
                    </owl:someValuesFrom>
                </owl:Restriction>
                <owl:Restriction>
                    <owl:onProperty rdf:resource="http://www.opendatainagriculture.com/ontologies/hazelnutontology#hasPercentegeValue"/>
                    <owl:someValuesFrom>
                        <rdfs:Datatype>
                            <owl:onDatatype rdf:resource="http://www.w3.org/2001/XMLSchema#double"/>
                            <owl:withRestrictions rdf:parseType="Collection">
                                <rdf:Description>
                                    <xsd:maxInclusive rdf:datatype="http://www.w3.org/2001/XMLSchema#double">0.5</xsd:maxInclusive>
                                </rdf:Description>
                            </owl:withRestrictions>
                        </rdfs:Datatype>
                    </owl:someValuesFrom>
                </owl:Restriction>
            </owl:intersectionOf>
        </owl:Class>
    </rdf:type>
    <hasTopography rdf:resource="http://www.opendatainagriculture.com/ontologies/hazelnutontology#Flat"/>
    <hasPercentegeValue rdf:datatype="http://www.w3.org/2001/XMLSchema#double"></hasPercentegeValue>
    <hasReferenceCultivars rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Impériale de Trébizonde</hasReferenceCultivars>
</owl:NamedIndividual>

0
0.5
特瑞比松德酒店

您是否已经尝试过自己进行查询?如果是这样的话,你能发一个帖子让我们看看你做错了什么吗?不,我现在正在努力。但是,我还不能这样做。(未测试):
select?ind?min?max where{inda[owl:intersectionOf([owl:someValuesFrom/owl:withRestrictions/xsd:minInclusive?min][owl:someValuesFrom/owl:withRestrictions/xsd:maxInclusive?max])}
谢谢您的回答。但是,我无法使用此代码获得任何查询结果。您好,欢迎使用StackOverflow!事实上,你的问题很难回答,因为目前还不清楚你已经尝试了什么,以及你被困在了哪里。请尝试回答您的问题以添加更多细节。看看如何写一个好问题的技巧。