Mark Miller
Mark Miller

Reputation: 3096

SPARQL insert containing expression

I would like to insert triple patterns like this into a Sesame endpoint, but I just can't seem to pull it all together

bind(UUID() as ?uuid) .
bind(now() as ?timeVal) .
:event1 :hasUuid ?uuid.
:event1 :hasTimestamp ?timeVal

Upvotes: 1

Views: 616

Answers (1)

Stanislav Kralin
Stanislav Kralin

Reputation: 11479

I'm not familiar with Sesame/RDF4J, but the following works with Jena ARQ:

INSERT
  { 
  :event1 :hasUuid ?uuid .
  :event1 :hasTimestamp ?timeVal .
  }
WHERE
  { SELECT ?uuid ?timeVal
    WHERE
      {
      BIND(UUID() AS ?uuid) .
      BIND(now() AS ?timeVal) .
      }
  }

Upvotes: 2

Related Questions