-
Notifications
You must be signed in to change notification settings - Fork 0
/
Sample5_Normalize.cs
89 lines (84 loc) · 2.96 KB
/
Sample5_Normalize.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
using Res = JsonLD.Demo.Resources.Resources;
using System;
using JsonLD.Core;
using Newtonsoft.Json.Linq;
namespace JsonLD.Demo
{
public static class Sample5_Normalize
{
private static readonly string _docJson = Res.ReadString("doc.json");
internal static void Run()
{
var doc = JObject.Parse(_docJson);
var opts = new JsonLdOptions();
var normalized = (RDFDataset)JsonLdProcessor.Normalize(doc, opts);
Console.WriteLine(normalized.Dump());
/*
Output:
@default
subject
type blank node
value _:c14n0
predicate
type IRI
value http://schema.org/image
object
type IRI
value http://manu.sporny.org/images/manu.png
---
subject
type blank node
value _:c14n0
predicate
type IRI
value http://schema.org/name
object
type literal
value Manu Sporny
datatype http://www.w3.org/2001/XMLSchema#string
---
subject
type blank node
value _:c14n0
predicate
type IRI
value http://schema.org/url
object
type IRI
value http://manu.sporny.org/
---
subject
type blank node
value _:c14n0
predicate
type IRI
value http://www.w3.org/1999/02/22-rdf-syntax-ns#type
object
type IRI
value http://schema.org/Person
---
subject
type IRI
value http://example.org/ld-experts
predicate
type IRI
value http://schema.org/member
object
type blank node
value _:c14n0
---
subject
type IRI
value http://example.org/ld-experts
predicate
type IRI
value http://schema.org/name
object
type literal
value LD Experts
datatype http://www.w3.org/2001/XMLSchema#string
---
*/
}
}
}