带有属性路径的Ruby SPARQL客户端*运算符语法

问题描述 投票:1回答:1

这个SPARQL查询示例工作正常:

require 'sparql/client'
rdfs_vocabulary = RDF::Vocabulary.new("http://www.w3.org/2000/01/rdf-schema#")
sparql_client.select.where(:x, rdfs_vocabulary.subClassOf, :type)

使用Property Path *运算符扩展它以获取所有子类,以下语法也适用:

sparql_client.select.where(:x, "<http://www.w3.org/2000/01/rdf-schema#subClassOf>*", :type)

但是有可能避免使用完整的URI吗?

ruby sparql rdf
1个回答
2
投票

试试sparql_client.select.where([:x, [RDF::RDFS.subClassOf,"*"], :type])

query_spec.rb。相关的GitHub issue

© www.soinside.com 2019 - 2024. All rights reserved.