Add mastodon-specific namespace to json-ld loader
This commit is contained in:
parent
c7cf5d9389
commit
3fba5550d5
2 changed files with 21 additions and 5 deletions
|
@ -0,0 +1,9 @@
|
||||||
|
{
|
||||||
|
"@context": {
|
||||||
|
"toot": "http://joinmastodon.org/ns#",
|
||||||
|
"discoverable": "toot:discoverable",
|
||||||
|
"devices": "toot:devices",
|
||||||
|
"featured": "toot:featured",
|
||||||
|
"featuredTags": "toot:featuredTags"
|
||||||
|
}
|
||||||
|
}
|
|
@ -19,6 +19,13 @@ public static class LdHelpers {
|
||||||
Document = JToken.Parse(File.ReadAllText(Path.Combine("Core", "Federation", "ActivityStreams",
|
Document = JToken.Parse(File.ReadAllText(Path.Combine("Core", "Federation", "ActivityStreams",
|
||||||
"Contexts", "security.json")))
|
"Contexts", "security.json")))
|
||||||
}
|
}
|
||||||
|
}, {
|
||||||
|
"http://joinmastodon.org/ns", new RemoteDocument {
|
||||||
|
ContextUrl = new Uri("http://joinmastodon.org/ns"),
|
||||||
|
DocumentUrl = new Uri("http://joinmastodon.org/ns"),
|
||||||
|
Document = JToken.Parse(File.ReadAllText(Path.Combine("Core", "Federation", "ActivityStreams",
|
||||||
|
"Contexts", "toot.json")))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -45,10 +52,10 @@ public static class LdHelpers {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static JObject? Compact(object obj) => Compact(JToken.FromObject(obj));
|
public static JObject? Compact(object obj) => Compact(JToken.FromObject(obj));
|
||||||
public static JArray? Expand(object obj) => Expand(JToken.FromObject(obj));
|
public static JArray? Expand(object obj) => Expand(JToken.FromObject(obj));
|
||||||
public static JObject? Compact(JToken? json) => JsonLdProcessor.Compact(json, DefaultContext, Options);
|
public static JObject? Compact(JToken? json) => JsonLdProcessor.Compact(json, DefaultContext, Options);
|
||||||
public static JArray? Expand(JToken? json) => JsonLdProcessor.Expand(json, Options);
|
public static JArray? Expand(JToken? json) => JsonLdProcessor.Expand(json, Options);
|
||||||
public static string Canonicalize(JArray json) => JsonLdProcessor.Canonicalize(json);
|
public static string Canonicalize(JArray json) => JsonLdProcessor.Canonicalize(json);
|
||||||
public static string Canonicalize(JObject json) => JsonLdProcessor.Canonicalize([json]);
|
public static string Canonicalize(JObject json) => JsonLdProcessor.Canonicalize([json]);
|
||||||
}
|
}
|
Loading…
Add table
Reference in a new issue