Skip to content

Add aliases at the schema level (In type) #4898

@MichelDiz

Description

@MichelDiz

Experience Report

reference: https://discuss.dgraph.io/t/support-json-ld-on-dgraph/7162

What you wanted to do

Add aliases at the schema level. To preserve my dataset.

Why that wasn't great, with examples

It is not possible.

e.g
Take this RDF for example.

_:b0 <http://www.w3.org/2002/12/cal/ical#location> "New Orleans Arena, New Orleans, Louisiana, USA" .

It is a very common type of RDF dataset source.

But it is hard to daily work or to use in APIs (like GraphQL). And every time you need to make a query, you need to manually write this whole line with an alias.

So, my suggestion would have an alias at the schema level like this:

type Example {
   location : <http://www.w3.org/2002/12/cal/ical#location>
}

So, instead of querying for <http://www.w3.org/2002/12/cal/ical#location> they would use location instead. And the predicate would be preserved in storage level.

It is good to preserve this information, in case the user needs to use the RDF in an application that uses web semantics from W3C standards and other information that this type of file (RDF) usually has.

It also prevents the user from having to sanitize the whole RDF, thereby completely changing its semantic information structure.

Even though we don't natively support the W3C's RDF standards. Still, if the user exports as JSON (Simulating JSON-LD). He can convert to W3C RDF easily using third-party applications.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stalearea/schemaIssues related to the schema language and capabilities.dgraphIssue or PR created by an internal Dgraph contributor.kind/featureSomething completely new we should consider.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions