Skip to content

Amazon Neptune RDF-star support for edge properties in RDF graphs

0

I am currently working with an Amazon Neptune RDF graph and evaluating a use case that requires storing properties on edges using RDF-star.

Specifically, I want to create a relationship (edge triple) between a parent and child vertex and then associate additional attributes directly with that relationship using RDF-star syntax.

First, I create the parent vertex:

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
INSERT DATA {
    GRAPH <test> {
        <http://example.org/parentVertex> rdf:type <http://example.org/Vertex> .
        <http://example.org/parentVertex> <http://example.org/uri> "parentVertex" .
    }
}

Next, I create the child vertex:

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
INSERT DATA {
    GRAPH <test> {
        <http://example.org/childVertex> rdf:type <http://example.org/Vertex> .
        <http://example.org/childVertex> <http://example.org/uri> "childVertex" .
    }
}

Both queries execute successfully in Amazon Neptune.

I then want to create an edge between the two vertices and assign properties directly to that edge using RDF-star:

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
INSERT DATA {
    GRAPH <test> {
        <http://example.org/parentVertex>
            <http://example.org/edgeName>
            <http://example.org/childVertex> .

        <<<http://example.org/parentVertex>
          <http://example.org/edgeName>
          <http://example.org/childVertex>>>
            <http://example.org/edgeProperty> "Edge value" .

        <<<http://example.org/parentVertex>
          <http://example.org/edgeName>
          <http://example.org/childVertex>>>
            <http://example.org/uri> "123" .
    }
}

However, when executing this query against Amazon Neptune, I receive the following error:

{
  "detailedMessage": "An unexpected error occurred while handling RDF data.",
  "code": "InternalFailureException",
  "requestId": "86d04fd1-682c-62f8-fd52-ef3cb450878c",
  "message": "An unexpected error occurred while handling RDF data."
}

Questions

1.) Is RDF-star currently supported by any Amazon Neptune engine version through the SPARQL endpoint?

2.) If RDF-star is not supported, what is the recommended approach for modeling edge-level (statement-level) properties in Neptune RDF graphs?

3.) Is there any publicly available roadmap or timeline for RDF-star support in Amazon Neptune?

Any guidance, best practices, or documentation references would be appreciated.

asked 2 months ago159 views

2 Answers
0

Based on the current Amazon Neptune documentation, RDF-star is not mentioned as a supported feature in Neptune's SPARQL implementation. Neptune complies with the SPARQL 1.1 Query Language and SPARQL 1.1 Update specification from the W3C, but RDF-star (which extends the RDF data model to allow triples as subjects or objects) is not part of the standard SPARQL 1.1 specification.

For modeling edge-level or statement-level properties in Neptune RDF graphs, the recommended approach is to use named graphs for reification-like patterns or consider alternative modeling strategies:

Named Graphs Approach: Neptune associates every triple with a named graph, and you can use named graphs to provide context or metadata about relationships. When loading or inserting triples, you can specify a named graph using the GRAPH keyword in your SPARQL INSERT statements. This allows you to group related triples together and query them as a unit.

Alternative Modeling: You could model edge properties by creating intermediate resources that represent the relationship itself, then attach properties to those intermediate resources. This is similar to traditional RDF reification but can be implemented in various ways depending on your specific use case.

Consider Property Graphs: If your use case heavily relies on edge properties, you might want to evaluate whether Neptune's property graph model using Gremlin would be more suitable. In the property graph model, edges are first-class citizens that can have properties directly attached to them. Edge properties are natively supported, where you can add properties to edges using the edge identifier.

Regarding a public roadmap or timeline for RDF-star support, this information is not available in the current Neptune documentation. For the most up-to-date information about feature availability and future enhancements, I recommend checking the AWS Neptune service updates or contacting AWS Support through the AWS Support Center at https://console.aws.amazon.com/support/.
Sources
SPARQL standards compliance in Amazon Neptune - Amazon Neptune
Neptune Graph Data Model - Amazon Neptune
Pool model for RDF - AWS Prescriptive Guidance
Loading data into Amazon Neptune using queries - Amazon Neptune

answered 2 months ago

0

RDF-star (or now the RDF 1.2 draft - not yet fully ratified), is not currently supported in any Neptune engine. Neptune only supports RDF / SPARQL 1.1 as of today. If you're attempting to model "edge properties" in RDF in Neptune, you can use named graphs instead:

GRAPH :statement_1 {
    :subject :predicate :object .
}

# Metadata about the named graph
:statement_1 :property1 :value1
             :property2 :value2 .

Neptune does not have a public roadmap. If interested in future support for RDF 1.2, please reach out to AWS Support or your AWS account team for them to file a feature request on your behalf.

AWS

answered 2 months ago

EXPERT

reviewed 5 days ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.