Skip to content

Commit aa84596

Browse files
committed
Clean up: whitespace, exception for PCL failures.
1 parent 998fc58 commit aa84596

22 files changed

+7292
-7272
lines changed

src/JsonLD/Core/DocumentLoader.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public virtual RemoteDocument LoadDocument(string url)
6060
}
6161
return doc;
6262
#else
63-
throw new NotImplementedException();
63+
throw new PlatformNotSupportedException();
6464
#endif
6565
}
6666

src/JsonLD/Core/IJSONLDTripleCallback.cs

+35-35
Original file line numberDiff line numberDiff line change
@@ -3,39 +3,39 @@
33

44
namespace JsonLD.Core
55
{
6-
/// <author>
7-
/// Tristan
8-
/// TODO: in the JSONLD RDF API the callback we're representing here is
9-
/// QuadCallback which takes a list of quads (subject, predicat, object,
10-
/// graph). for the moment i'm just going to use the dataset provided by
11-
/// toRDF but this should probably change in the future
12-
/// </author>
13-
public interface IJSONLDTripleCallback
14-
{
15-
/// <summary>Construct output based on internal RDF dataset format</summary>
16-
/// <param name="dataset">
17-
/// The format of the dataset is a Map with the following
18-
/// structure: { GRAPH_1: [ TRIPLE_1, TRIPLE_2, ..., TRIPLE_N ],
19-
/// GRAPH_2: [ TRIPLE_1, TRIPLE_2, ..., TRIPLE_N ], ... GRAPH_N: [
20-
/// TRIPLE_1, TRIPLE_2, ..., TRIPLE_N ] }
21-
/// GRAPH: Is the graph name/IRI. if no graph is present for a
22-
/// triple, it will be listed under the "@default" graph TRIPLE:
23-
/// Is a map with the following structure: { "subject" : SUBJECT
24-
/// "predicate" : PREDICATE "object" : OBJECT }
25-
/// Each of the values in the triple map are also maps with the
26-
/// following key-value pairs: "value" : The value of the node.
27-
/// "subject" can be an IRI or blank node id. "predicate" should
28-
/// only ever be an IRI "object" can be and IRI or blank node id,
29-
/// or a literal value (represented as a string) "type" : "IRI" if
30-
/// the value is an IRI or "blank node" if the value is a blank
31-
/// node. "object" can also be "literal" in the case of literals.
32-
/// The value of "object" can also contain the following optional
33-
/// key-value pairs: "language" : the language value of a string
34-
/// literal "datatype" : the datatype of the literal. (if not set
35-
/// will default to XSD:string, if set to null, null will be
36-
/// used).
37-
/// </param>
38-
/// <returns>the resulting RDF object in the desired format</returns>
39-
object Call(RDFDataset dataset);
40-
}
6+
/// <author>
7+
/// Tristan
8+
/// TODO: in the JSONLD RDF API the callback we're representing here is
9+
/// QuadCallback which takes a list of quads (subject, predicat, object,
10+
/// graph). for the moment i'm just going to use the dataset provided by
11+
/// toRDF but this should probably change in the future
12+
/// </author>
13+
public interface IJSONLDTripleCallback
14+
{
15+
/// <summary>Construct output based on internal RDF dataset format</summary>
16+
/// <param name="dataset">
17+
/// The format of the dataset is a Map with the following
18+
/// structure: { GRAPH_1: [ TRIPLE_1, TRIPLE_2, ..., TRIPLE_N ],
19+
/// GRAPH_2: [ TRIPLE_1, TRIPLE_2, ..., TRIPLE_N ], ... GRAPH_N: [
20+
/// TRIPLE_1, TRIPLE_2, ..., TRIPLE_N ] }
21+
/// GRAPH: Is the graph name/IRI. if no graph is present for a
22+
/// triple, it will be listed under the "@default" graph TRIPLE:
23+
/// Is a map with the following structure: { "subject" : SUBJECT
24+
/// "predicate" : PREDICATE "object" : OBJECT }
25+
/// Each of the values in the triple map are also maps with the
26+
/// following key-value pairs: "value" : The value of the node.
27+
/// "subject" can be an IRI or blank node id. "predicate" should
28+
/// only ever be an IRI "object" can be and IRI or blank node id,
29+
/// or a literal value (represented as a string) "type" : "IRI" if
30+
/// the value is an IRI or "blank node" if the value is a blank
31+
/// node. "object" can also be "literal" in the case of literals.
32+
/// The value of "object" can also contain the following optional
33+
/// key-value pairs: "language" : the language value of a string
34+
/// literal "datatype" : the datatype of the literal. (if not set
35+
/// will default to XSD:string, if set to null, null will be
36+
/// used).
37+
/// </param>
38+
/// <returns>the resulting RDF object in the desired format</returns>
39+
object Call(RDFDataset dataset);
40+
}
4141
}

src/JsonLD/Core/IRDFParser.cs

+43-43
Original file line numberDiff line numberDiff line change
@@ -3,47 +3,47 @@
33

44
namespace JsonLD.Core
55
{
6-
/// <summary>
7-
/// Interface for parsing RDF into the RDF Dataset objects to be used by
8-
/// JSONLD.fromRDF
9-
/// </summary>
10-
/// <author>Tristan</author>
11-
public interface IRDFParser
12-
{
13-
/// <summary>
14-
/// Parse the input into the internal RDF Dataset format The format is a Map
15-
/// with the following structure: { GRAPH_1: [ TRIPLE_1, TRIPLE_2, ...,
16-
/// TRIPLE_N ], GRAPH_2: [ TRIPLE_1, TRIPLE_2, ..., TRIPLE_N ], ...
17-
/// </summary>
18-
/// <remarks>
19-
/// Parse the input into the internal RDF Dataset format The format is a Map
20-
/// with the following structure: { GRAPH_1: [ TRIPLE_1, TRIPLE_2, ...,
21-
/// TRIPLE_N ], GRAPH_2: [ TRIPLE_1, TRIPLE_2, ..., TRIPLE_N ], ... GRAPH_N:
22-
/// [ TRIPLE_1, TRIPLE_2, ..., TRIPLE_N ] }
23-
/// GRAPH: Must be the graph name/IRI. if no graph is present for a triple,
24-
/// add it to the "@default" graph TRIPLE: Must be a map with the following
25-
/// structure: { "subject" : SUBJECT "predicate" : PREDICATE "object" :
26-
/// OBJECT }
27-
/// Each of the values in the triple map must also be a map with the
28-
/// following key-value pairs: "value" : The value of the node. "subject" can
29-
/// be an IRI or blank node id. "predicate" should only ever be an IRI
30-
/// "object" can be and IRI or blank node id, or a literal value (represented
31-
/// as a string) "type" : "IRI" if the value is an IRI or "blank node" if the
32-
/// value is a blank node. "object" can also be "literal" in the case of
33-
/// literals. The value of "object" can also contain the following optional
34-
/// key-value pairs: "language" : the language value of a string literal
35-
/// "datatype" : the datatype of the literal. (if not set will default to
36-
/// XSD:string, if set to null, null will be used).
37-
/// The RDFDatasetUtils class has the following helper methods to make
38-
/// generating this format easier: result = getInitialRDFDatasetResult();
39-
/// triple = generateTriple(s,p,o); triple =
40-
/// generateTriple(s,p,value,datatype,language);
41-
/// addTripleToRDFDatasetResult(result, graphName, triple);
42-
/// </remarks>
43-
/// <param name="dataset">The RDF library specific input to parse</param>
44-
/// <returns>input in internal RDF Dataset format</returns>
45-
/// <exception cref="JsonLdError">JsonLdError</exception>
46-
/// <exception cref="JsonLD.Core.JsonLdError"></exception>
47-
RDFDataset Parse(JToken input);
48-
}
6+
/// <summary>
7+
/// Interface for parsing RDF into the RDF Dataset objects to be used by
8+
/// JSONLD.fromRDF
9+
/// </summary>
10+
/// <author>Tristan</author>
11+
public interface IRDFParser
12+
{
13+
/// <summary>
14+
/// Parse the input into the internal RDF Dataset format The format is a Map
15+
/// with the following structure: { GRAPH_1: [ TRIPLE_1, TRIPLE_2, ...,
16+
/// TRIPLE_N ], GRAPH_2: [ TRIPLE_1, TRIPLE_2, ..., TRIPLE_N ], ...
17+
/// </summary>
18+
/// <remarks>
19+
/// Parse the input into the internal RDF Dataset format The format is a Map
20+
/// with the following structure: { GRAPH_1: [ TRIPLE_1, TRIPLE_2, ...,
21+
/// TRIPLE_N ], GRAPH_2: [ TRIPLE_1, TRIPLE_2, ..., TRIPLE_N ], ... GRAPH_N:
22+
/// [ TRIPLE_1, TRIPLE_2, ..., TRIPLE_N ] }
23+
/// GRAPH: Must be the graph name/IRI. if no graph is present for a triple,
24+
/// add it to the "@default" graph TRIPLE: Must be a map with the following
25+
/// structure: { "subject" : SUBJECT "predicate" : PREDICATE "object" :
26+
/// OBJECT }
27+
/// Each of the values in the triple map must also be a map with the
28+
/// following key-value pairs: "value" : The value of the node. "subject" can
29+
/// be an IRI or blank node id. "predicate" should only ever be an IRI
30+
/// "object" can be and IRI or blank node id, or a literal value (represented
31+
/// as a string) "type" : "IRI" if the value is an IRI or "blank node" if the
32+
/// value is a blank node. "object" can also be "literal" in the case of
33+
/// literals. The value of "object" can also contain the following optional
34+
/// key-value pairs: "language" : the language value of a string literal
35+
/// "datatype" : the datatype of the literal. (if not set will default to
36+
/// XSD:string, if set to null, null will be used).
37+
/// The RDFDatasetUtils class has the following helper methods to make
38+
/// generating this format easier: result = getInitialRDFDatasetResult();
39+
/// triple = generateTriple(s,p,o); triple =
40+
/// generateTriple(s,p,value,datatype,language);
41+
/// addTripleToRDFDatasetResult(result, graphName, triple);
42+
/// </remarks>
43+
/// <param name="dataset">The RDF library specific input to parse</param>
44+
/// <returns>input in internal RDF Dataset format</returns>
45+
/// <exception cref="JsonLdError">JsonLdError</exception>
46+
/// <exception cref="JsonLD.Core.JsonLdError"></exception>
47+
RDFDataset Parse(JToken input);
48+
}
4949
}

src/JsonLD/Core/JSONLDConsts.cs

+25-25
Original file line numberDiff line numberDiff line change
@@ -2,48 +2,48 @@
22

33
namespace JsonLD.Core
44
{
5-
/// <summary>URI Constants used in the JSON-LD parser.</summary>
6-
/// <remarks>URI Constants used in the JSON-LD parser.</remarks>
7-
public sealed class JSONLDConsts
8-
{
9-
public const string RdfSyntaxNs = "http://www.w3.org/1999/02/22-rdf-syntax-ns#";
5+
/// <summary>URI Constants used in the JSON-LD parser.</summary>
6+
/// <remarks>URI Constants used in the JSON-LD parser.</remarks>
7+
public sealed class JSONLDConsts
8+
{
9+
public const string RdfSyntaxNs = "http://www.w3.org/1999/02/22-rdf-syntax-ns#";
1010

11-
public const string RdfSchemaNs = "http://www.w3.org/2000/01/rdf-schema#";
11+
public const string RdfSchemaNs = "http://www.w3.org/2000/01/rdf-schema#";
1212

13-
public const string XsdNs = "http://www.w3.org/2001/XMLSchema#";
13+
public const string XsdNs = "http://www.w3.org/2001/XMLSchema#";
1414

15-
public const string XsdAnytype = XsdNs + "anyType";
15+
public const string XsdAnytype = XsdNs + "anyType";
1616

17-
public const string XsdBoolean = XsdNs + "boolean";
17+
public const string XsdBoolean = XsdNs + "boolean";
1818

19-
public const string XsdDouble = XsdNs + "double";
19+
public const string XsdDouble = XsdNs + "double";
2020

21-
public const string XsdInteger = XsdNs + "integer";
21+
public const string XsdInteger = XsdNs + "integer";
2222

23-
public const string XsdFloat = XsdNs + "float";
23+
public const string XsdFloat = XsdNs + "float";
2424

25-
public const string XsdDecimal = XsdNs + "decimal";
25+
public const string XsdDecimal = XsdNs + "decimal";
2626

27-
public const string XsdAnyuri = XsdNs + "anyURI";
27+
public const string XsdAnyuri = XsdNs + "anyURI";
2828

29-
public const string XsdString = XsdNs + "string";
29+
public const string XsdString = XsdNs + "string";
3030

31-
public const string RdfType = RdfSyntaxNs + "type";
31+
public const string RdfType = RdfSyntaxNs + "type";
3232

33-
public const string RdfFirst = RdfSyntaxNs + "first";
33+
public const string RdfFirst = RdfSyntaxNs + "first";
3434

35-
public const string RdfRest = RdfSyntaxNs + "rest";
35+
public const string RdfRest = RdfSyntaxNs + "rest";
3636

37-
public const string RdfNil = RdfSyntaxNs + "nil";
37+
public const string RdfNil = RdfSyntaxNs + "nil";
3838

39-
public const string RdfPlainLiteral = RdfSyntaxNs + "PlainLiteral";
39+
public const string RdfPlainLiteral = RdfSyntaxNs + "PlainLiteral";
4040

41-
public const string RdfXmlLiteral = RdfSyntaxNs + "XMLLiteral";
41+
public const string RdfXmlLiteral = RdfSyntaxNs + "XMLLiteral";
4242

43-
public const string RdfObject = RdfSyntaxNs + "object";
43+
public const string RdfObject = RdfSyntaxNs + "object";
4444

45-
public const string RdfLangstring = RdfSyntaxNs + "langString";
45+
public const string RdfLangstring = RdfSyntaxNs + "langString";
4646

47-
public const string RdfList = RdfSyntaxNs + "List";
48-
}
47+
public const string RdfList = RdfSyntaxNs + "List";
48+
}
4949
}

0 commit comments

Comments
 (0)