Ruby SPARQL Client with Property Path Unary * Operator syntax

◇◆丶佛笑我妖孽 提交于 2019-12-11 11:28:48

问题


This SPARQL query example works fine:

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)

Extending it with the Property Path * operator to get all subclasses, the following syntax works as well:

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

but is it possible to avoid the full-URI?


回答1:


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

See query_spec.rb. Related GitHub issue.



来源:https://stackoverflow.com/questions/54791831/ruby-sparql-client-with-property-path-unary-operator-syntax

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!