DEV Community

Cover image for Introducing Linked Objects
Melvin Carvalho
Melvin Carvalho

Posted on • Edited on

3 1

Introducing Linked Objects

What is a Linked Object?

A linked object is is an object which you get from an URL, the URL is its id.

What are the Benefits?

It allows you to update nested objects independently of each other and reference them within multiple different objects since they are by reference.

Linked Object Notation (LION)

The Linked Objects Notation (LION) is a simple subset of JSON-LD. It aims to avoid most of the complexity, and enables getting started quickly, using a familiar notation. LION is compatible with JSON-LD and offers a full upgrade path.

A Simple Example

<script type="application/ld+json">
{
  "@id": "http://dbpedia.org/resource/John_Lennon",
  "name": "John Lennon",
  "born": "1940-10-09",
  "spouse": "http://dbpedia.org/resource/Cynthia_Lennon"
}
</script>
Enter fullscreen mode Exit fullscreen mode

@id

@id is the URL of the object. It can also be written "id". The @id can be absolute or relative. @id is optional but recommended, and makes an object into an Linked Object.

@type

@type is the type of for that object. It can also be written "type". @type normally maps to a URL. Type is optional.

@context

@context is optional. It provides full compatibility with JSON-LD and and maps various items in the object to URLs in a more readable way.

Spec

Full details on @id , @type and @context can be found in here

References

Linked Objects is Open Source

Linked Objects is open source under the MIT license. Please visit our repository or raise an issue

API Trace View

Struggling with slow API calls?

Dan Mindru walks through how he used Sentry's new Trace View feature to shave off 22.3 seconds from an API call.

Get a practical walkthrough of how to identify bottlenecks, split tasks into multiple parallel tasks, identify slow AI model calls, and more.

Read more →

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs