-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
106 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
namespace Fedora; | ||
|
||
public static class ContentTypes | ||
{ | ||
public const string JsonLd = "application/ld+json"; | ||
public const string NTriples = "application/n-triples"; | ||
public const string RdfXml = "application/rdf+xml"; | ||
public const string TextN3 = "text/n3"; | ||
public const string TextPlain = "text/plain"; | ||
public const string TextTurtle = "text/turtle"; | ||
|
||
public static string FormatAcceptsHeader(string contentType, string jsonLdMode = JsonLdModes.Expanded) | ||
{ | ||
if (jsonLdMode == JsonLdModes.Expanded || contentType != JsonLd) | ||
{ | ||
// expanded is the default | ||
return contentType; | ||
} | ||
|
||
return $"{JsonLd}; profile=\"{jsonLdMode}\""; | ||
} | ||
} | ||
|
||
public static class JsonLdModes | ||
{ | ||
/// <summary> | ||
/// The default Fedora JSON-LD representation | ||
/// </summary> | ||
public const string Expanded = "\"http://www.w3.org/ns/json-ld#expanded\""; | ||
|
||
|
||
/// <summary> | ||
/// Compacted JSON-LD (not the default) | ||
/// </summary> | ||
public const string Compacted = "\"http://www.w3.org/ns/json-ld#compacted\""; | ||
|
||
|
||
/// <summary> | ||
/// Flattened JSON-LD (not the default) | ||
/// </summary> | ||
public const string Flattened = "\"http://www.w3.org/ns/json-ld#flattened\""; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
namespace Fedora; | ||
|
||
public static class Prefer | ||
{ | ||
/// <summary> | ||
/// Include assertions from other Fedora resources to this node (excluded from representation by default) | ||
/// </summary> | ||
public const string PreferInboundReferences = "http://fedora.info/definitions/fcrepo#PreferInboundReferences"; | ||
|
||
/// <summary> | ||
/// Embed server managed properties in the representation (enabled by default) | ||
/// </summary> | ||
public const string ServerManaged = "http://fedora.info/definitions/fcrepo#ServerManaged"; | ||
|
||
/// <summary> | ||
/// Include/Exclude "ldp:contains" assertions to contained resources(enabled by default) | ||
/// </summary> | ||
public const string PreferContainment = "http://www.w3.org/ns/ldp#PreferContainment"; | ||
|
||
/// <summary> | ||
/// Include/Exclude assertions to member resources established by the Direct and Indirect containers(enabled by default) | ||
/// </summary> | ||
public const string PreferMembership = "http://www.w3.org/ns/ldp#PreferMembership"; | ||
|
||
/// <summary> | ||
/// Include/Exclude triples that would be present when the container is empty(enabled by default) | ||
/// </summary> | ||
public const string PreferMinimalContainer = "http://www.w3.org/ns/ldp#PreferMinimalContainer"; | ||
|
||
/// <summary> | ||
/// Embed "child" resources in the returned representation | ||
/// </summary> | ||
public const string PreferContainedDescriptions = "http://www.w3.org/ns/oa#PreferContainedDescriptions"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters