Linked Open Data Urls

FEAR will generate URIs for entities based on the entity type and a random number sequence. It is possible to specify the URI of an entity, however it should be noted that this is just for the URL used, and is not used for resolving an entity in the graph. To resolve an entity in a graph the identified by clauses will always be used.

There are a number of caveats when dealing with URIs for Linked Open Data in FEAR.

  • Only the trailing path, after the authority, is supplied as the script is usable for graphs that may have different names.
  • Fields that exist in the data supplied to the script can be accessed. This may limit what entities you can specify the URI on.
  • As entity search is done with the identified by clause, an entity may exist with a different URI. The URI definition is only used if an entity needs to be created.

Uri Segments

To specify the URI to construct for an entity, the following example demonstrates how to add the URI construction definition to a create entity statement. The same definition can be applied to the result statement.

create entity myPersonEntity <"/Person/{LastName}/{FirstName}"> as foaf:Person with
{
   ...
}

In an example of an object with a FirstName of Jack, and LastName of Smith, if a foaf:Person needs to be created for this entity, the entity will have a URL composed of the graph namespace, followed by /Person/Smith/Jack.