diff --git a/Nancy.Rdf.sln b/Nancy.Rdf.sln index 7626d04..9024235 100644 --- a/Nancy.Rdf.sln +++ b/Nancy.Rdf.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 14 -VisualStudioVersion = 14.0.24720.0 +VisualStudioVersion = 14.0.23107.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Nancy.Rdf", "src\Nancy.Rdf\Nancy.Rdf.csproj", "{D789D63C-821B-410B-A953-DFEBCBFC9D40}" EndProject @@ -11,7 +11,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution ProjectSection(SolutionItems) = preProject after.Nancy.Rdf.sln.targets = after.Nancy.Rdf.sln.targets appveyor.yml = appveyor.yml - src\Common\Common.props = src\Common\Common.props GitVersionConfig.yaml = GitVersionConfig.yaml paket.dependencies = paket.dependencies paket.lock = paket.lock diff --git a/paket.dependencies b/paket.dependencies index d493ef8..e4f702e 100644 --- a/paket.dependencies +++ b/paket.dependencies @@ -16,7 +16,7 @@ nuget OpenCover nuget SpecFlow nuget FakeItEasy nuget NUnit < 3 -nuget StyleCopPlus.MSBuild +nuget StyleCop.Analyzers nuget GitLink nuget JsonLd.Entities prerelease nuget Nullguard.Fody diff --git a/paket.lock b/paket.lock index 4685778..d051ecb 100644 --- a/paket.lock +++ b/paket.lock @@ -8,19 +8,17 @@ NUGET dotNetRDF (1.0.9.3683) HtmlAgilityPack (>= 1.4.9) Newtonsoft.Json (>= 6.0.8) - VDS.Common (1.6.0) - FakeItEasy (1.25.3) - FluentAssertions (4.2.2) + VDS.Common (1.6) + FakeItEasy (2.0) + FluentAssertions (4.6.3) Fody (1.29.4) - gitlink (2.2.0) - GitVersionTask (3.4.1) + gitlink (2.2) + GitVersionTask (3.5.4) HtmlAgilityPack (1.4.9) JetBrainsAnnotations.Fody (1.0.4) Fody (>= 1.29.2) - JsonLd.Entities (0.3.1) - json-ld.net - json-ld.net (1.0.4) - Newtonsoft.Json (>= 4.0.1) + json-ld.net (1.0.5) + Newtonsoft.Json (>= 6.0.4) Microsoft.Owin (3.0.1) Owin (>= 1.0) Microsoft.Owin.Host.SystemWeb (3.0.1) @@ -42,9 +40,11 @@ NUGET NUnit (2.6.4) OpenCover (4.6.519) Owin (1.0) - Rdf.Vocabularies (1.1.0) - SpecFlow (2.0.0) - StyleCop.MSBuild (4.7.50) - StyleCopPlus.MSBuild (4.7.49.5) - StyleCop.MSBuild (>= 4.7.49.0) - VDS.Common (1.6.0) + Rdf.Vocabularies (1.1.1) + SpecFlow (2.1) + StyleCop.Analyzers (1.0) + VDS.Common (1.6) + remote: https://ci.appveyor.com/nuget/jsonld-entities-aavhsnxi7xjp + specs: + JsonLD.Entities (0.3.3) + json-ld.net diff --git a/src/Common/Common.props b/src/Common/Common.props index afe8f37..47e0448 100644 --- a/src/Common/Common.props +++ b/src/Common/Common.props @@ -1,10 +1,5 @@ - - - false - - false true diff --git a/src/Example/Nancy.Rdf.Sample/Nancy.Rdf.Sample.csproj b/src/Example/Nancy.Rdf.Sample/Nancy.Rdf.Sample.csproj index acbe4d9..b04a84c 100644 --- a/src/Example/Nancy.Rdf.Sample/Nancy.Rdf.Sample.csproj +++ b/src/Example/Nancy.Rdf.Sample/Nancy.Rdf.Sample.csproj @@ -121,7 +121,7 @@ - ..\..\..\packages\JsonLd.Entities\lib\net40\JsonLD.Entities.dll + ..\..\..\packages\JsonLD.Entities\lib\net40\JsonLD.Entities.dll True True @@ -131,8 +131,8 @@ - - ..\..\..\packages\json-ld.net\lib\net40-Client\JsonLD.dll + + ..\..\..\packages\json-ld.net\lib\net40-client\json-ld.net.dll True True diff --git a/src/Nancy.Rdf.Tests/Nancy.Rdf.Tests.csproj b/src/Nancy.Rdf.Tests/Nancy.Rdf.Tests.csproj index 6d01e9a..44f6de3 100644 --- a/src/Nancy.Rdf.Tests/Nancy.Rdf.Tests.csproj +++ b/src/Nancy.Rdf.Tests/Nancy.Rdf.Tests.csproj @@ -98,6 +98,20 @@ + + + + <__paket__GitVersionTask_targets>portable-net+sl+win+wpa+wp\GitVersionTask + + + + + + + <__paket__Fody_targets>portable-net+sl+win+wpa+wp\Fody + + + @@ -164,20 +178,6 @@ - - - - <__paket__Fody_targets>portable-net+sl+win+wpa+wp\Fody - - - - - - - <__paket__GitVersionTask_targets>\packages\GitVersionTask\Build\portable-net+sl+win+wpa+wp\GitVersionTask - - - @@ -213,7 +213,7 @@ - ..\..\packages\JsonLd.Entities\lib\net40\JsonLD.Entities.dll + ..\..\packages\JsonLD.Entities\lib\net40\JsonLD.Entities.dll True True @@ -223,8 +223,8 @@ - - ..\..\packages\json-ld.net\lib\net40-Client\JsonLD.dll + + ..\..\packages\json-ld.net\lib\net40-client\json-ld.net.dll True True @@ -306,20 +306,19 @@ - - - - <__paket__StyleCop_MSBuild_Targets>StyleCop.MSBuild - - - - - - - <__paket__StyleCopPlus_MSBuild_props>StyleCopPlus.MSBuild - - - + + + + + True + + + True + + + True + + @@ -331,8 +330,4 @@ - - - - \ No newline at end of file diff --git a/src/Nancy.Rdf.Tests/paket.references b/src/Nancy.Rdf.Tests/paket.references index 65f0fde..a551524 100644 --- a/src/Nancy.Rdf.Tests/paket.references +++ b/src/Nancy.Rdf.Tests/paket.references @@ -9,5 +9,5 @@ JsonLd.Entities Nancy.Testing FluentAssertions JetbrainsAnnotations.Fody -StyleCopPlus.MSBuild +StyleCop.Analyzers Rdf.Vocabularies \ No newline at end of file diff --git a/src/Nancy.Rdf/DefaultNamespaceManager.cs b/src/Nancy.Rdf/DictionaryNamespaceManager.cs similarity index 100% rename from src/Nancy.Rdf/DefaultNamespaceManager.cs rename to src/Nancy.Rdf/DictionaryNamespaceManager.cs diff --git a/src/Nancy.Rdf/Nancy.Rdf.csproj b/src/Nancy.Rdf/Nancy.Rdf.csproj index dbe9845..c4e5b7e 100644 --- a/src/Nancy.Rdf/Nancy.Rdf.csproj +++ b/src/Nancy.Rdf/Nancy.Rdf.csproj @@ -24,6 +24,7 @@ prompt 4 bin\Debug\Nancy.Rdf.xml + Nancy.Rdf.ruleset pdbonly @@ -33,6 +34,8 @@ prompt 4 bin\Release\Nancy.Rdf.xml + true + Nancy.Rdf.ruleset @@ -50,7 +53,7 @@ - + @@ -82,19 +85,16 @@ + - - - ..\..\packages\dotNetRDF\lib\net40\dotNetRDF.dll - True - True - - + + <__paket__GitVersionTask_targets>portable-net+sl+win+wpa+wp\GitVersionTask + @@ -106,9 +106,13 @@ - - <__paket__GitVersionTask_targets>\packages\GitVersionTask\Build\portable-net+sl+win+wpa+wp\GitVersionTask - + + + ..\..\packages\dotNetRDF\lib\net40\dotNetRDF.dll + True + True + + @@ -135,7 +139,7 @@ - ..\..\packages\JsonLd.Entities\lib\net40\JsonLD.Entities.dll + ..\..\packages\JsonLD.Entities\lib\net40\JsonLD.Entities.dll True True @@ -145,8 +149,8 @@ - - ..\..\packages\json-ld.net\lib\net40-Client\JsonLD.dll + + ..\..\packages\json-ld.net\lib\net40-client\json-ld.net.dll True True @@ -206,20 +210,19 @@ - - - - <__paket__StyleCop_MSBuild_Targets>StyleCop.MSBuild - - - - - - - <__paket__StyleCopPlus_MSBuild_props>StyleCopPlus.MSBuild - - - + + + + + True + + + True + + + True + + @@ -231,8 +234,4 @@ - - - - \ No newline at end of file diff --git a/src/Nancy.Rdf/Nancy.Rdf.ruleset b/src/Nancy.Rdf/Nancy.Rdf.ruleset new file mode 100644 index 0000000..0baeacb --- /dev/null +++ b/src/Nancy.Rdf/Nancy.Rdf.ruleset @@ -0,0 +1,238 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Nancy.Rdf/RdfSerialization.cs b/src/Nancy.Rdf/RdfSerialization.cs index f9b88a4..a7e69ce 100644 --- a/src/Nancy.Rdf/RdfSerialization.cs +++ b/src/Nancy.Rdf/RdfSerialization.cs @@ -104,29 +104,25 @@ public string Extension } #pragma warning disable 1591 - [SuppressMessage("Microsoft.StyleCop.CSharp.DocumentationRules", "SA1600:ElementsMustBeDocumented", - Justification = "Operator or built-in override")] + [SuppressMessage("Microsoft.StyleCop.CSharp.DocumentationRules", "SA1600:ElementsMustBeDocumented", Justification = "Operator or built-in override")] public static bool operator ==(RdfSerialization left, RdfSerialization right) { return left.Equals(right); } - [SuppressMessage("Microsoft.StyleCop.CSharp.DocumentationRules", "SA1600:ElementsMustBeDocumented", - Justification = "Operator or built-in override")] + [SuppressMessage("Microsoft.StyleCop.CSharp.DocumentationRules", "SA1600:ElementsMustBeDocumented", Justification = "Operator or built-in override")] public static bool operator !=(RdfSerialization left, RdfSerialization right) { return !left.Equals(right); } - [SuppressMessage("Microsoft.StyleCop.CSharp.DocumentationRules", "SA1600:ElementsMustBeDocumented", - Justification = "Operator or built-in override")] + [SuppressMessage("Microsoft.StyleCop.CSharp.DocumentationRules", "SA1600:ElementsMustBeDocumented", Justification = "Operator or built-in override")] public bool Equals(RdfSerialization other) { return string.Equals(_mediaType, other._mediaType) && string.Equals(_extension, other._extension); } - [SuppressMessage("Microsoft.StyleCop.CSharp.DocumentationRules", "SA1600:ElementsMustBeDocumented", - Justification = "Operator or built-in override")] + [SuppressMessage("Microsoft.StyleCop.CSharp.DocumentationRules", "SA1600:ElementsMustBeDocumented", Justification = "Operator or built-in override")] public override bool Equals(object obj) { if (ReferenceEquals(null, obj)) @@ -137,8 +133,7 @@ public override bool Equals(object obj) return obj is RdfSerialization && Equals((RdfSerialization)obj); } - [SuppressMessage("Microsoft.StyleCop.CSharp.DocumentationRules", "SA1600:ElementsMustBeDocumented", - Justification = "Operator or built-in override")] + [SuppressMessage("Microsoft.StyleCop.CSharp.DocumentationRules", "SA1600:ElementsMustBeDocumented", Justification = "Operator or built-in override")] public override int GetHashCode() { unchecked @@ -149,7 +144,7 @@ public override int GetHashCode() #pragma warning restore /// - /// Returns a that represents this instance. + /// Returns a that represents this instance. /// public override string ToString() { diff --git a/src/Nancy.Rdf/Responses/RdfSerializer.cs b/src/Nancy.Rdf/Responses/RdfSerializer.cs index 5b13e1d..5c1a30f 100644 --- a/src/Nancy.Rdf/Responses/RdfSerializer.cs +++ b/src/Nancy.Rdf/Responses/RdfSerializer.cs @@ -7,7 +7,6 @@ using JsonLD.Entities; using Nancy.IO; using VDS.RDF; -using Vocab; namespace Nancy.Rdf.Responses { @@ -53,13 +52,13 @@ public void Serialize(string contentType, TModel model, Stream outputStr using (var writer = new StreamWriter(new UnclosableStreamWrapper(outputStream))) { - var jsObject = _entitySerializer.Serialize(actualModel); + var javascriptObject = _entitySerializer.Serialize(actualModel); if (wrappedModel != null) { - jsObject.AddBaseToContext(wrappedModel.Value.BaseUrl); + javascriptObject.AddBaseToContext(wrappedModel.Value.BaseUrl); } - var rdf = (RDFDataset)JsonLdProcessor.ToRDF(jsObject); + var rdf = (RDFDataset)JsonLdProcessor.ToRDF(javascriptObject); WriteRdf(writer, rdf.GetQuads("@default").Select(ToTriple)); } @@ -70,27 +69,6 @@ public void Serialize(string contentType, TModel model, Stream outputStr /// protected abstract void WriteRdf(StreamWriter writer, IEnumerable triples); - [Obsolete("Remove when json-ld.net is fixed")] - private static string FixSerializedValue(string literal, Uri datatype) - { - switch (datatype.ToString()) - { - case Xsd.boolean: - return literal.ToLower(); - case Xsd.dateTime: - case Xsd.date: - DateTime dateTime; - if (DateTime.TryParse(literal, out dateTime)) - { - return XmlConvert.ToString(dateTime, XmlDateTimeSerializationMode.RoundtripKind); - } - - break; - } - - return literal; - } - private INode CreateNode(RDFDataset.Node node) { if (node.IsIRI()) @@ -106,8 +84,6 @@ private INode CreateNode(RDFDataset.Node node) var literal = node.GetValue(); var datatype = new Uri(node.GetDatatype()); - literal = FixSerializedValue(literal, datatype); - return _nodeFactory.CreateLiteralNode(literal, datatype); } diff --git a/src/Nancy.Rdf/app.config b/src/Nancy.Rdf/app.config index f072f57..326e7f9 100644 --- a/src/Nancy.Rdf/app.config +++ b/src/Nancy.Rdf/app.config @@ -1,3 +1,9 @@  - + + + True + + + + diff --git a/src/Nancy.Rdf/paket.references b/src/Nancy.Rdf/paket.references index 86f8133..866cb25 100644 --- a/src/Nancy.Rdf/paket.references +++ b/src/Nancy.Rdf/paket.references @@ -3,5 +3,5 @@ Nancy GitVersionTask JsonLd.Entities NullGuard.Fody -StyleCopPlus.MSBuild +StyleCop.Analyzers Rdf.Vocabularies \ No newline at end of file