Skip to content

WIP: Add Graph property support #182

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion Source/Schema.NET/JsonLdObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,18 @@ public class JsonLdObject : IEquatable<JsonLdObject>
[DataMember(Name = "@type", Order = 1)]
public virtual string Type { get; }

/// <summary>
/// Gets or sets the graph entities for the current JSON-LD document.
/// At times, it is necessary to make statements about a graph itself, rather than just a single node.
/// This can be done by grouping a set of nodes using the @graph keyword.
/// When a JSON-LD document's top-level structure is an object that contains no other properties than @graph and
/// optionally @context (properties that are not mapped to an IRI or a keyword are ignored), @graph is considered
/// to express the otherwise implicit default graph. This mechanism can be useful when a number of nodes exist
/// at the document's top level that share the same context, which is, e.g., the case when a document is flattened.
/// </summary>
[DataMember(Name = "@graph", Order = 2)]
public virtual OneOrMany<IThing> Graph { get; set; }

/// <summary>
/// Gets or sets the identifier used to uniquely identify things that are being described in the document with
/// IRIs or blank node identifiers.
Expand All @@ -42,7 +54,7 @@ public class JsonLdObject : IEquatable<JsonLdObject>
/// result in a representation of that node.This may allow an application to retrieve further information about
/// a node. In JSON-LD, a node is identified using the @id keyword:
/// </summary>
[DataMember(Name = "@id", Order = 2)]
[DataMember(Name = "@id", Order = 3)]
public virtual Uri Id { get; set; }

/// <inheritdoc/>
Expand Down