forked from dotnetrdf/dotnetrdf
-
Notifications
You must be signed in to change notification settings - Fork 0
UserGuide JsonLd Compaction
Kal Ahmed edited this page May 30, 2017
·
1 revision
User Guide > JSON-LD API > Compaction
Compaction is the opposite to Expansion. The compaction process applies a context to a JSON-LD document and uses it to shorten IRIs to terms or CURIES and compress JSON-LD values to simple strings or numbers. For more information please refer to the JSON-LD API Specification.
The Compaction operation is implemented through the static method JsonLdProcessor.Compact (and in the .NET Standard framework the asynchronous JsonLdProcessor.CompactAsync method). This method accepts three parameters:
-
input- aNewtonsoft.Linq.JTokenthat represents the input document to be processed or the URI of the document to be retrieved and processed. The input may be one of the following types:- A JObject representing a parsed JSON-LD document
- A JValue with a string value which is the URI of the JSON-LD document to retrieve and parse
-
context- aNewtonsoft.Linq.JTokenthat represents the context to be applied to the input document. Thecontextvalue may be one of the following types:- A JObject representing a parsed JSON-LD context
- A JValue with a string value which is the URI of the JSON-LD document to retrieve and parse
- A JArray of JObject or JValue items which represents a collection of contexts to be combined and applied to the input document.
-
options- a JsonLdProcessorOptions instance providing the options for the compaction operation.
The output of the method is a Newtonsoft.Json.Linq.JObject that represents the compacted JSON-LD document.
- Getting Started
- Library Overview
- Hello World
- Reading RDF
- Writing RDF
- Working With Graphs
- Typed Values and Lists
- Working with Triple Stores
- Building SPARQL
- Querying with SPARQL
- Updating with SPARQL
- Exceptions
- Equality and Comparison
- Event Model
- Utility Methods
- Extension Methods
- Using the Namespace Mapper
- Storage API
- Advanced SPARQL
- Ontology API
- Inference and Reasoning
- ASP.NET Integration
- Global Options
- Formatting API
-
Configuration API
- Graphs
- Triple Stores
- Object Factories
- Readers and Writers
- SPARQL Endpoints
- Query Processors
- Update Processors
- Protocol Processors
- SPARQL Datasets
- SPARQL Expression Factories
- SPARQL Operators
- SPARQL Optimisers
- Full Text Query
- Reasoners
- Storage Providers
- User Groups
- Permissions
- Users
- Static Options
- Proxy Servers
- Handlers API
- JSON-LD API
- Tools