Skip to content

Commit

Permalink
Clean up: whitespace, exception for PCL failures.
Browse files Browse the repository at this point in the history
  • Loading branch information
sblom committed Jun 24, 2014
1 parent 998fc58 commit aa84596
Show file tree
Hide file tree
Showing 22 changed files with 7,292 additions and 7,272 deletions.
2 changes: 1 addition & 1 deletion src/JsonLD/Core/DocumentLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public virtual RemoteDocument LoadDocument(string url)
}
return doc;
#else
throw new NotImplementedException();
throw new PlatformNotSupportedException();
#endif
}

Expand Down
70 changes: 35 additions & 35 deletions src/JsonLD/Core/IJSONLDTripleCallback.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,39 @@

namespace JsonLD.Core
{
/// <author>
/// Tristan
/// TODO: in the JSONLD RDF API the callback we're representing here is
/// QuadCallback which takes a list of quads (subject, predicat, object,
/// graph). for the moment i'm just going to use the dataset provided by
/// toRDF but this should probably change in the future
/// </author>
public interface IJSONLDTripleCallback
{
/// <summary>Construct output based on internal RDF dataset format</summary>
/// <param name="dataset">
/// The format of the dataset is a Map with the following
/// structure: { GRAPH_1: [ TRIPLE_1, TRIPLE_2, ..., TRIPLE_N ],
/// GRAPH_2: [ TRIPLE_1, TRIPLE_2, ..., TRIPLE_N ], ... GRAPH_N: [
/// TRIPLE_1, TRIPLE_2, ..., TRIPLE_N ] }
/// GRAPH: Is the graph name/IRI. if no graph is present for a
/// triple, it will be listed under the "@default" graph TRIPLE:
/// Is a map with the following structure: { "subject" : SUBJECT
/// "predicate" : PREDICATE "object" : OBJECT }
/// Each of the values in the triple map are also maps with the
/// following key-value pairs: "value" : The value of the node.
/// "subject" can be an IRI or blank node id. "predicate" should
/// only ever be an IRI "object" can be and IRI or blank node id,
/// or a literal value (represented as a string) "type" : "IRI" if
/// the value is an IRI or "blank node" if the value is a blank
/// node. "object" can also be "literal" in the case of literals.
/// The value of "object" can also contain the following optional
/// key-value pairs: "language" : the language value of a string
/// literal "datatype" : the datatype of the literal. (if not set
/// will default to XSD:string, if set to null, null will be
/// used).
/// </param>
/// <returns>the resulting RDF object in the desired format</returns>
object Call(RDFDataset dataset);
}
/// <author>
/// Tristan
/// TODO: in the JSONLD RDF API the callback we're representing here is
/// QuadCallback which takes a list of quads (subject, predicat, object,
/// graph). for the moment i'm just going to use the dataset provided by
/// toRDF but this should probably change in the future
/// </author>
public interface IJSONLDTripleCallback
{
/// <summary>Construct output based on internal RDF dataset format</summary>
/// <param name="dataset">
/// The format of the dataset is a Map with the following
/// structure: { GRAPH_1: [ TRIPLE_1, TRIPLE_2, ..., TRIPLE_N ],
/// GRAPH_2: [ TRIPLE_1, TRIPLE_2, ..., TRIPLE_N ], ... GRAPH_N: [
/// TRIPLE_1, TRIPLE_2, ..., TRIPLE_N ] }
/// GRAPH: Is the graph name/IRI. if no graph is present for a
/// triple, it will be listed under the "@default" graph TRIPLE:
/// Is a map with the following structure: { "subject" : SUBJECT
/// "predicate" : PREDICATE "object" : OBJECT }
/// Each of the values in the triple map are also maps with the
/// following key-value pairs: "value" : The value of the node.
/// "subject" can be an IRI or blank node id. "predicate" should
/// only ever be an IRI "object" can be and IRI or blank node id,
/// or a literal value (represented as a string) "type" : "IRI" if
/// the value is an IRI or "blank node" if the value is a blank
/// node. "object" can also be "literal" in the case of literals.
/// The value of "object" can also contain the following optional
/// key-value pairs: "language" : the language value of a string
/// literal "datatype" : the datatype of the literal. (if not set
/// will default to XSD:string, if set to null, null will be
/// used).
/// </param>
/// <returns>the resulting RDF object in the desired format</returns>
object Call(RDFDataset dataset);
}
}
86 changes: 43 additions & 43 deletions src/JsonLD/Core/IRDFParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,47 +3,47 @@

namespace JsonLD.Core
{
/// <summary>
/// Interface for parsing RDF into the RDF Dataset objects to be used by
/// JSONLD.fromRDF
/// </summary>
/// <author>Tristan</author>
public interface IRDFParser
{
/// <summary>
/// Parse the input into the internal RDF Dataset format The format is a Map
/// with the following structure: { GRAPH_1: [ TRIPLE_1, TRIPLE_2, ...,
/// TRIPLE_N ], GRAPH_2: [ TRIPLE_1, TRIPLE_2, ..., TRIPLE_N ], ...
/// </summary>
/// <remarks>
/// Parse the input into the internal RDF Dataset format The format is a Map
/// with the following structure: { GRAPH_1: [ TRIPLE_1, TRIPLE_2, ...,
/// TRIPLE_N ], GRAPH_2: [ TRIPLE_1, TRIPLE_2, ..., TRIPLE_N ], ... GRAPH_N:
/// [ TRIPLE_1, TRIPLE_2, ..., TRIPLE_N ] }
/// GRAPH: Must be the graph name/IRI. if no graph is present for a triple,
/// add it to the "@default" graph TRIPLE: Must be a map with the following
/// structure: { "subject" : SUBJECT "predicate" : PREDICATE "object" :
/// OBJECT }
/// Each of the values in the triple map must also be a map with the
/// following key-value pairs: "value" : The value of the node. "subject" can
/// be an IRI or blank node id. "predicate" should only ever be an IRI
/// "object" can be and IRI or blank node id, or a literal value (represented
/// as a string) "type" : "IRI" if the value is an IRI or "blank node" if the
/// value is a blank node. "object" can also be "literal" in the case of
/// literals. The value of "object" can also contain the following optional
/// key-value pairs: "language" : the language value of a string literal
/// "datatype" : the datatype of the literal. (if not set will default to
/// XSD:string, if set to null, null will be used).
/// The RDFDatasetUtils class has the following helper methods to make
/// generating this format easier: result = getInitialRDFDatasetResult();
/// triple = generateTriple(s,p,o); triple =
/// generateTriple(s,p,value,datatype,language);
/// addTripleToRDFDatasetResult(result, graphName, triple);
/// </remarks>
/// <param name="dataset">The RDF library specific input to parse</param>
/// <returns>input in internal RDF Dataset format</returns>
/// <exception cref="JsonLdError">JsonLdError</exception>
/// <exception cref="JsonLD.Core.JsonLdError"></exception>
RDFDataset Parse(JToken input);
}
/// <summary>
/// Interface for parsing RDF into the RDF Dataset objects to be used by
/// JSONLD.fromRDF
/// </summary>
/// <author>Tristan</author>
public interface IRDFParser
{
/// <summary>
/// Parse the input into the internal RDF Dataset format The format is a Map
/// with the following structure: { GRAPH_1: [ TRIPLE_1, TRIPLE_2, ...,
/// TRIPLE_N ], GRAPH_2: [ TRIPLE_1, TRIPLE_2, ..., TRIPLE_N ], ...
/// </summary>
/// <remarks>
/// Parse the input into the internal RDF Dataset format The format is a Map
/// with the following structure: { GRAPH_1: [ TRIPLE_1, TRIPLE_2, ...,
/// TRIPLE_N ], GRAPH_2: [ TRIPLE_1, TRIPLE_2, ..., TRIPLE_N ], ... GRAPH_N:
/// [ TRIPLE_1, TRIPLE_2, ..., TRIPLE_N ] }
/// GRAPH: Must be the graph name/IRI. if no graph is present for a triple,
/// add it to the "@default" graph TRIPLE: Must be a map with the following
/// structure: { "subject" : SUBJECT "predicate" : PREDICATE "object" :
/// OBJECT }
/// Each of the values in the triple map must also be a map with the
/// following key-value pairs: "value" : The value of the node. "subject" can
/// be an IRI or blank node id. "predicate" should only ever be an IRI
/// "object" can be and IRI or blank node id, or a literal value (represented
/// as a string) "type" : "IRI" if the value is an IRI or "blank node" if the
/// value is a blank node. "object" can also be "literal" in the case of
/// literals. The value of "object" can also contain the following optional
/// key-value pairs: "language" : the language value of a string literal
/// "datatype" : the datatype of the literal. (if not set will default to
/// XSD:string, if set to null, null will be used).
/// The RDFDatasetUtils class has the following helper methods to make
/// generating this format easier: result = getInitialRDFDatasetResult();
/// triple = generateTriple(s,p,o); triple =
/// generateTriple(s,p,value,datatype,language);
/// addTripleToRDFDatasetResult(result, graphName, triple);
/// </remarks>
/// <param name="dataset">The RDF library specific input to parse</param>
/// <returns>input in internal RDF Dataset format</returns>
/// <exception cref="JsonLdError">JsonLdError</exception>
/// <exception cref="JsonLD.Core.JsonLdError"></exception>
RDFDataset Parse(JToken input);
}
}
50 changes: 25 additions & 25 deletions src/JsonLD/Core/JSONLDConsts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,48 +2,48 @@

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

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

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

public const string XsdAnytype = XsdNs + "anyType";
public const string XsdAnytype = XsdNs + "anyType";

public const string XsdBoolean = XsdNs + "boolean";
public const string XsdBoolean = XsdNs + "boolean";

public const string XsdDouble = XsdNs + "double";
public const string XsdDouble = XsdNs + "double";

public const string XsdInteger = XsdNs + "integer";
public const string XsdInteger = XsdNs + "integer";

public const string XsdFloat = XsdNs + "float";
public const string XsdFloat = XsdNs + "float";

public const string XsdDecimal = XsdNs + "decimal";
public const string XsdDecimal = XsdNs + "decimal";

public const string XsdAnyuri = XsdNs + "anyURI";
public const string XsdAnyuri = XsdNs + "anyURI";

public const string XsdString = XsdNs + "string";
public const string XsdString = XsdNs + "string";

public const string RdfType = RdfSyntaxNs + "type";
public const string RdfType = RdfSyntaxNs + "type";

public const string RdfFirst = RdfSyntaxNs + "first";
public const string RdfFirst = RdfSyntaxNs + "first";

public const string RdfRest = RdfSyntaxNs + "rest";
public const string RdfRest = RdfSyntaxNs + "rest";

public const string RdfNil = RdfSyntaxNs + "nil";
public const string RdfNil = RdfSyntaxNs + "nil";

public const string RdfPlainLiteral = RdfSyntaxNs + "PlainLiteral";
public const string RdfPlainLiteral = RdfSyntaxNs + "PlainLiteral";

public const string RdfXmlLiteral = RdfSyntaxNs + "XMLLiteral";
public const string RdfXmlLiteral = RdfSyntaxNs + "XMLLiteral";

public const string RdfObject = RdfSyntaxNs + "object";
public const string RdfObject = RdfSyntaxNs + "object";

public const string RdfLangstring = RdfSyntaxNs + "langString";
public const string RdfLangstring = RdfSyntaxNs + "langString";

public const string RdfList = RdfSyntaxNs + "List";
}
public const string RdfList = RdfSyntaxNs + "List";
}
}
Loading

0 comments on commit aa84596

Please sign in to comment.