Ruby SPARQL Client with Property Path Unary * Oper

2019-07-25 02:20发布

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?

标签: ruby sparql rdf
1条回答
等我变得足够好
2楼-- · 2019-07-25 02:49

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

See query_spec.rb. Related GitHub issue.

查看更多
登录 后发表回答