lib/rdf/blazegraph/rest_client.rb
##
# Checks for existence of a statement matching the pattern.
#
# Errors are thrown if a bnode is given for any of the terms or if a 
# literal is given in the subject or predicate place.
#
# @param [Boolean] include_inferred  includes inferred triples if `true', 
#   default: `false`
# 
# @return [Boolean] true if statement matching the pattern exists
#
# @raise [RequestError] if the request is invalid or the server throws an 
#   error
Checks for existence of a statement matching the pattern.
Errors are thrown if a bnode is given for any of the terms or if a
literal is given in the subject or predicate place.
Checks for existence of a statement matching the pattern . Errors are thrown if a bnode is given for any of the terms or if a literal is given in the subject or predicate place .
def has_statement?(subject: nil, predicate: nil, object: nil, 
                       context: nil, include_inferred: false)
      if [subject, predicate, object].compact.find(&:node?)
        sparql_ask_statement([subject, predicate, object], context)
      else
        st_query = access_path_query(subject, predicate, object, context)
        query = "?HASSTMT#{st_query}&include_inferred=#{include_inferred}"
        read_boolean_response(execute(query))
      end
    end
def has_statement? ( subject : nil , predicate : nil , object : nil , context : nil , include_inferred : false ) if [ subject , predicate , object ] . compact . find ( & :node? ) sparql_ask_statement ( [ subject , predicate , object ] , context ) else st_query = access_path_query ( subject , predicate , object , context ) query = "?HASSTMT#{st_query}&include_inferred=#{include_inferred}" read_boolean_response ( execute ( query ) ) end end
Checks for existence of a statement matching the pattern.
Checks for existence of a statement matching the pattern .
true if statement matching the pattern exists
true if statement matching the pattern exists
Boolean
[RequestError] if the request is invalid or the server throws an error
[ RequestError ] if the request is invalid or the server throws an error
subject
<not_specific>
predicate
<not_specific>
object
<not_specific>
context
<not_specific>
include_inferred
<not_specific>
<not_specific>
include_inferred includes inferred triples if `true', default: `false`
include_inferred includes inferred triples if ` true ' default : ` false `