Skip to content

Commit 9eadfe7

Browse files
authored
Support for props over getters/setters + initial OSLC RM support (#322)
1 parent 8c83782 commit 9eadfe7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+3242
-275
lines changed

.github/workflows/main.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@ jobs:
8787
- name: Target ${{ matrix.version.target }} only
8888
shell: pwsh
8989
run: |
90-
(Get-Content Tests/OSLC4Net.ChangeManagementTest/OSLC4Net.ChangeManagementTest.csproj) |
90+
(Get-Content Tests/OSLC4Net.Test.RefImpl/OSLC4Net.Test.RefImpl.csproj) |
9191
ForEach-Object { $_ -replace '>net8.0<', '>${{ matrix.version.target }}<' } |
92-
Set-Content Tests/OSLC4Net.ChangeManagementTest/OSLC4Net.ChangeManagementTest.csproj
92+
Set-Content Tests/OSLC4Net.Test.RefImpl/OSLC4Net.Test.RefImpl.csproj
9393
(Get-Content Tests/OSLC4Net.Client.Tests/OSLC4Net.Client.Tests.csproj) |
9494
ForEach-Object { $_ -replace '>net8.0<', '>${{ matrix.version.target }}<' } |
9595
Set-Content Tests/OSLC4Net.Client.Tests/OSLC4Net.Client.Tests.csproj

CHANGELOG.md

+115-48
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6-
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7-
8-
Legend: 🔒️ security fixes; ⚡️ major features/updates; ❗️ breaking changes; 👉 important notes.
6+
and this project adheres
7+
to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
98

9+
Legend: 🔒️ security fixes; ⚡️ major features/updates; ❗️ breaking changes; 👉
10+
important notes.
1011

1112
## [0.5.0] - 2025-04-13
1213

@@ -16,10 +17,17 @@ This release does not contain security updates.
1617

1718
### Added
1819

19-
- ⚡️ CI integration tests against OSLC RefImpl based on NET Aspire
20-
- Redirect loop protection for `OslcClient` (max 20 redirects as in Firefox/Blink/WebKit)
21-
- Follow redirects on more responses statuses (was: 301, became: 301, 302, 307, 308, and in case of GET requests, 303 too)
22-
- ❗️ `OslcResponse` can now expose multiple response resources, the `Graph` and, in case of error, the `oslc:Error` resource.
20+
- ⚡️ CI integration tests against OSLC RefImpl CM/RM based on NET Aspire
21+
- ⚡️ Ability to define OSLC resource POCOs using C# properties instead of
22+
Java-style getters/setters.
23+
- ⚡️ Support for the OSLC Requirements Management 2.1 domain with property-based code.
24+
- Added full vocabulary definitions for FOAF, DC Terms, DC Elements, LDP, PROV-O, QUDT, SKOS.
25+
- Redirect loop protection for `OslcClient` (max 20 redirects as in
26+
Firefox/Blink/WebKit)
27+
- Follow redirects on more responses statuses (was: 301, became: 301, 302, 307,
28+
308, and in case of GET requests, 303 too)
29+
- ❗️ `OslcResponse` can now expose multiple response resources, the `Graph` and,
30+
in case of error, the `oslc:Error` resource.
2331

2432
### Changed
2533

@@ -29,7 +37,9 @@ This release does not contain security updates.
2937
### Deprecated
3038

3139
- Most non-async methods in client classes.
32-
- Further OSLC JSON deprecations. Clients should rely on RDF instead (RDF/XML, Turtle)
40+
- Further OSLC JSON deprecations. Clients should rely on RDF instead (RDF/XML,
41+
Turtle)
42+
- Old OSLC Requirements Management classes that were hand-rolled and used Java code style.
3343

3444
### Removed
3545

@@ -38,8 +48,8 @@ This release does not contain security updates.
3848

3949
### Fixed
4050

41-
- Minor bug fixes to pass acceptance tests against OSLC RefImpl Change Management server.
42-
51+
- Minor bug fixes to pass acceptance tests against OSLC RefImpl Change
52+
Management server.
4353

4454
## [0.4.6] - 2024-11-15
4555

@@ -71,8 +81,10 @@ This release does not remove any features.
7181

7282
### Security
7383

74-
- 🔒️ Transitive dependency System.Net.Http was set to version 4.3.4 to avoid failing the build when NU1903 is treated as error.
75-
- 🔒️ Transitive dependency System.Text.RegularExpressions was set to version 4.3.1 to avoid failing the build when NU1903 is treated as error.
84+
- 🔒️ Transitive dependency System.Net.Http was set to version 4.3.4 to avoid
85+
failing the build when NU1903 is treated as error.
86+
- 🔒️ Transitive dependency System.Text.RegularExpressions was set to version
87+
4.3.1 to avoid failing the build when NU1903 is treated as error.
7688

7789
### Added
7890

@@ -82,22 +94,27 @@ This release does not contain new features.
8294

8395
- Significant build changes to manage package versions centrally.
8496
- NuGet/assembly versions are now set based on the git tag name.
85-
- 👉 "snapshot" builds how have the version similar to 999.9.9-ts.202410192025, where 202410192025 is a timestamp; please note that such snapshot builds are only available via [Github Packages](https://github.com/orgs/OSLC/packages?repo_name=oslc4net).
97+
- 👉 "snapshot" builds how have the version similar to 999.9.9-ts.202410192025,
98+
where 202410192025 is a timestamp; please note that such snapshot builds are
99+
only available
100+
via [Github Packages](https://github.com/orgs/OSLC/packages?repo_name=oslc4net).
86101

87102
### Deprecated
88103

89104
This release does not introduce deprecations.
90105

91106
### Removed
92107

93-
- Dependencies on "bridge" packages added during the migration from .NET Framework to .NET 6:
94-
- System.Configuration.ConfigurationManager
95-
- System.Data.DataSetExtensions
96-
- Microsoft.CSharp
108+
- Dependencies on "bridge" packages added during the migration from .NET
109+
Framework to .NET 6:
110+
- System.Configuration.ConfigurationManager
111+
- System.Data.DataSetExtensions
112+
- Microsoft.CSharp
97113

98114
### Fixed
99115

100-
- Example and test project had `<IsPackable>false</IsPackable>` property set to prevent pushing their packages to NuGet.
116+
- Example and test project had `<IsPackable>false</IsPackable>` property set to
117+
prevent pushing their packages to NuGet.
101118

102119
## [0.4.4] - 2024-10-19
103120

@@ -111,56 +128,82 @@ This release does not contain security updates.
111128

112129
### Added
113130

114-
- ️⚡️ An example project using `OslcClient` and basic auth to retrieve a WorkItem (OSLC ChangeRequest) from Jazz.
131+
- ️⚡️ An example project using `OslcClient` and basic auth to retrieve a
132+
WorkItem (OSLC ChangeRequest) from Jazz.
115133
- ``OslcClient::ForBasicAuth()`` factory method.
116-
- ️️️⚡️ ``OslcClient.GetResourceAsync()`` strongly typed async method that returns `OslcResponse<T>` with either a typed resource or an error.
117-
- Support for complex MIME type strings for content negotiation. Current `Accept` string is set to ``text/turtle;q=1.0, application/rdf+xml;q=0.9, application/n-triples;q=0.8, text/n3;q=0.7`` by default.
134+
- ️️️⚡️ ``OslcClient.GetResourceAsync()`` strongly typed async method that
135+
returns `OslcResponse<T>` with either a typed resource or an error.
136+
- Support for complex MIME type strings for content negotiation. Current
137+
`Accept` string is set to
138+
``text/turtle;q=1.0, application/rdf+xml;q=0.9, application/n-triples;q=0.8, text/n3;q=0.7``
139+
by default.
118140
- OSLC Query results now expose a `.TotalCount` property.
119141

120142
### Changed
121143

122144
- ❗️ `OSLC4Net.Client` now requires `netstandard2.1` (was: `netstandard2.0`)
123-
- Upgraded dotNetRDF to [v3.3.0](https://github.com/dotnetrdf/dotnetrdf/releases/tag/v3.3.0)
145+
- Upgraded dotNetRDF
146+
to [v3.3.0](https://github.com/dotnetrdf/dotnetrdf/releases/tag/v3.3.0)
124147

125148
### Deprecated
126149

127-
- Some constructors on `OslcClient` were deprecated (around skipping TLS checks).
128-
- 👉 log4net logging will be replaced with the standard Microsoft [ILogger](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.ilogger?view=net-8.0) in a future release.
129-
- Direct use of `IEnumerator` properties on `OslcQueryResponse` to iterate over response pages.
130-
- Multiple symbols on OSLC Query related code with Java-like signatures (various `Get*` methods) and string types. Prefer C# props of type `Uri`.
150+
- Some constructors on `OslcClient` were deprecated (around skipping TLS
151+
checks).
152+
- 👉 log4net logging will be replaced with the standard
153+
Microsoft [ILogger](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.ilogger?view=net-8.0)
154+
in a future release.
155+
- Direct use of `IEnumerator` properties on `OslcQueryResponse` to iterate over
156+
response pages.
157+
- Multiple symbols on OSLC Query related code with Java-like signatures (various
158+
`Get*` methods) and string types. Prefer C# props of type `Uri`.
131159

132160
### Removed
133161

134162
This release does not remove any features.
135163

136164
### Fixed
137165

138-
- `OslcClient` no longer overwrites most of the headers (#204). It was a similar issue to #19 (but happening with `OslcRestClient`).
139-
- Ensure OSLC Query responses are processed correctly when they contain multiple `oslc:ResponseInfo` objects ([!203](https://github.com/OSLC/oslc4net/pull/203)).
140-
166+
- `OslcClient` no longer overwrites most of the headers (#204). It was a similar
167+
issue to #19 (but happening with `OslcRestClient`).
168+
- Ensure OSLC Query responses are processed correctly when they contain multiple
169+
`oslc:ResponseInfo`
170+
objects ([!203](https://github.com/OSLC/oslc4net/pull/203)).
141171

142172
## [0.4.2] - 2024-10-09
143173

144174
### Security
145175

146-
- 🔒️❗️ `OSLC4Net.Client` now defaults to strong TLS certificate checking. Skipping TLS checks now requires explicit configuration.
176+
- 🔒️❗️ `OSLC4Net.Client` now defaults to strong TLS certificate checking.
177+
Skipping TLS checks now requires explicit configuration.
147178

148179
### Added
149180

150-
- ⚡️ Support for .NET 6+ was added by migrating most of the projects in the solution to target `netstandard2.0`.
181+
- ⚡️ Support for .NET 6+ was added by migrating most of the projects in the
182+
solution to target `netstandard2.0`.
151183

152184
### Changed
153185

154-
- ⚡️ `OSLC4Net.Core` now targets `netstandard2.0`, which allows it to be used under .NET Framework 4.7.2 or higher as well as .NET 6+.
186+
- ⚡️ `OSLC4Net.Core` now targets `netstandard2.0`, which allows it to be used
187+
under .NET Framework 4.7.2 or higher as well as .NET 6+.
155188
- ⚡️ dotNetRDF was upgraded from v1 to v3 to enable targeting `netstandard2.0`.
156-
- One of the key breaking changes is that `ITriple` and `INode` no longer have the `.Graph` property.
157-
- ❗️ This caused breaking changes to some of the method signatures in `OSLC4Net.DotNetRdfProvider` to allow the `IGraph` instance to be passed.
189+
- One of the key breaking changes is that `ITriple` and `INode` no longer
190+
have the `.Graph` property.
191+
- ❗️ This caused breaking changes to some of the method signatures in
192+
`OSLC4Net.DotNetRdfProvider` to allow the `IGraph` instance to be passed.
158193
- `OSLC4Net.Client` now targets `netstandard2.0`.
159-
- ❗️ The main breaking change is the replacement of the legacy `WebRequestHandler` with `HttpClientHandler`. This caused some method/constructor signatures to change.
160-
- ❗️ `RemoteCertificateValidationCallback` was replaced with a lambda function.
161-
- `OSLC4Net.Query` now targets `netstandard2.0`. The Antlr3 runtime package targeting PCL was replaced with a package targeting NETStandard1.0 (Antlr 4 targets NETStandard2.0).
162-
- ❗️ `JsonMediaTypeFormatter` was renamed into `OslcJsonMediaTypeFormatter` to better reflect its purpose (support a bespoke OSLC JSON format) and avoid conflict with `System.Net.Http.Formatting.MediaTypeFormatter`.
163-
- Test projects were migrated from MSTestV2 to xUnit (except for integration tests for OSLC CM)
194+
- ❗️ The main breaking change is the replacement of the legacy
195+
`WebRequestHandler` with `HttpClientHandler`. This caused some
196+
method/constructor signatures to change.
197+
- ❗️ `RemoteCertificateValidationCallback` was replaced with a lambda
198+
function.
199+
- `OSLC4Net.Query` now targets `netstandard2.0`. The Antlr3 runtime package
200+
targeting PCL was replaced with a package targeting NETStandard1.0 (Antlr 4
201+
targets NETStandard2.0).
202+
- ❗️ `JsonMediaTypeFormatter` was renamed into `OslcJsonMediaTypeFormatter` to
203+
better reflect its purpose (support a bespoke OSLC JSON format) and avoid
204+
conflict with `System.Net.Http.Formatting.MediaTypeFormatter`.
205+
- Test projects were migrated from MSTestV2 to xUnit (except for integration
206+
tests for OSLC CM)
164207

165208
### Deprecated
166209

@@ -171,7 +214,8 @@ This release does not remove any features.
171214
### Removed
172215

173216
- .NET 7 support was removed since the SDK has reached EOL.
174-
- `Newtonsoft.Json` package was only used in the StockQuoteSample ASP.NET MVC project. Its references were removed from all other projects.
217+
- `Newtonsoft.Json` package was only used in the StockQuoteSample ASP.NET MVC
218+
project. Its references were removed from all other projects.
175219

176220
### Fixed
177221

@@ -190,33 +234,48 @@ YANKED due to NuGet deployment issues.
190234
### Security
191235

192236
- 🔒️ **Updated `log4net` in response to CVE-2018-1285 (CVSS 9.8/10).**
193-
- 🔒️ **Updated `Newtonsoft.Json` in response to [CWE-755](https://cwe.mitre.org/data/definitions/755.html).**
237+
- 🔒️ **Updated `Newtonsoft.Json` in response
238+
to [CWE-755](https://cwe.mitre.org/data/definitions/755.html).**
194239

195240
### Added
196241

197242
- CI configuration based on Github Actions (MSBuild, NuGet, VStest).
198243

199244
### Changed
200245

201-
- 👉 Since 2017-04-15, the project is hosted on Github under the OSLC community org.
246+
- 👉 Since 2017-04-15, the project is hosted on Github under the OSLC community
247+
org.
202248
- The project now targets .NET 4.8 instead of .NET 4.5.
203-
- ⚡️ Nuget project configuration was migrated from `packages.config` to PackageReference.
249+
- ⚡️ Nuget project configuration was migrated from `packages.config` to
250+
PackageReference.
204251
- ⚡️ The StockQuoteSample was updated to ASP.NET MVC 5.
205-
- Migrated from MSBuild-based NuGet package restore to NuGet 2.7+ Automatic Package Restore.
206-
- Migrated from MSTestV1 (`Microsoft.VisualStudio.QualityTools.UnitTestFramework`) to MSTestV2 (`MSTest.Test*`).
207-
- ❗️👉 **`AssemblyVersion` was set to `0.3.0.0`** (from 1.0.0.0 in the v0.2.3). This could be a breaking change in some cases, but given that the project was used by a small number of people, the version being obviously wrong (given being present in the 0.2.3 release) and not having a Nuget release before, we decided to go ahead. Furthermore, switching from a direct assembly reference or a project reference to a Nuget package would require changes to the project references anyway.
252+
- Migrated from MSBuild-based NuGet package restore to NuGet 2.7+ Automatic
253+
Package Restore.
254+
- Migrated from MSTestV1 (
255+
`Microsoft.VisualStudio.QualityTools.UnitTestFramework`) to MSTestV2 (
256+
`MSTest.Test*`).
257+
- ❗️👉 **`AssemblyVersion` was set to `0.3.0.0`** (from 1.0.0.0 in the v0.2.3).
258+
This could be a breaking change in some cases, but given that the project was
259+
used by a small number of people, the version being obviously wrong (given
260+
being present in the 0.2.3 release) and not having a Nuget release before, we
261+
decided to go ahead. Furthermore, switching from a direct assembly reference
262+
or a project reference to a Nuget package would require changes to the project
263+
references anyway.
208264

209265
### Deprecated
210266

211-
- Service Provider Catalog autodetection on the local host, port 8080, should not be relied upon, as the corresponding logic is deprecated.
267+
- Service Provider Catalog autodetection on the local host, port 8080, should
268+
not be relied upon, as the corresponding logic is deprecated.
212269

213270
### Removed
214271

215272
- ❗️ Support for .NET 4.5, 4.6, and 4.7 was dropped.
216273

217274
### Fixed
218275

219-
- `System.Net.Http.Formatting` issues were resolved by removing references to related SDK-provider assemblies, assembly extensions, and replacing them with a uniform reference to `Microsoft.AspNet.WebApi.Client` 5.2.9.
276+
- `System.Net.Http.Formatting` issues were resolved by removing references to
277+
related SDK-provider assemblies, assembly extensions, and replacing them with
278+
a uniform reference to `Microsoft.AspNet.WebApi.Client` 5.2.9.
220279

221280
## [0.2.3] - 2013-07-26
222281

@@ -278,11 +337,19 @@ This release does not contain bug fixes.
278337

279338

280339
[UNRELEASED]: https://github.com/OSLC/oslc4net/compare/v0.5.0...HEAD
340+
281341
[0.5.0]: https://github.com/OSLC/oslc4net/releases/tag/v0.5.0
342+
282343
[0.4.6]: https://github.com/OSLC/oslc4net/releases/tag/v0.4.6
344+
283345
[0.4.5]: https://github.com/OSLC/oslc4net/releases/tag/v0.4.5
346+
284347
[0.4.4]: https://github.com/OSLC/oslc4net/releases/tag/v0.4.4
348+
285349
[0.4.3]: https://github.com/OSLC/oslc4net/releases/tag/v0.4.3
350+
286351
[0.4.2]: https://github.com/OSLC/oslc4net/releases/tag/v0.4.2
352+
287353
[0.3.0-alpha]: https://github.com/OSLC/oslc4net/releases/tag/v0.3.0-alpha
354+
288355
[0.2.3]: https://github.com/OSLC/oslc4net/releases/tag/v0.2.3

OSLC4Net_SDK/Directory.Build.props

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424

2525

2626
<ItemGroup>
27-
<SourceRoot Include="$(MSBuildThisFileDirectory)/" />
28-
<None Include="$(SolutionDir)\..\README.md" Pack="true" PackagePath="README.md" />
27+
<SourceRoot Include="$(MSBuildThisFileDirectory)/"/>
28+
<None Include="$(SolutionDir)\..\README.md" Pack="true" PackagePath="README.md"/>
2929
</ItemGroup>
3030

3131
<PropertyGroup>

OSLC4Net_SDK/OSLC4Net.Client/Oslc/Resources/Requirement.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ namespace OSLC4Net.Client.Oslc.Resources;
2424
/// </summary>
2525
[OslcNamespace(RmConstants.REQUIREMENTS_MANAGEMENT_NAMESPACE)]
2626
[OslcResourceShape(title = "Requirement Resource Shape", describes = new string[] { RmConstants.TYPE_REQUIREMENT })]
27+
[Obsolete("See OSLC4Net.Domains.RequirementsManagement")]
2728
public class Requirement : RequirementBase
2829
{
2930
public Requirement()
@@ -37,6 +38,7 @@ public Requirement(Uri about) : base(about)
3738
}
3839
}
3940

41+
[Obsolete("See OSLC4Net.Domains.RequirementsManagement")]
4042
public abstract class RequirementBase : AbstractResource
4143
{
4244
private string? _title;
@@ -615,4 +617,4 @@ public void SetSubjects(string[] subjects)
615617

616618
if (subjects != null) _subjects.AddAll(subjects);
617619
}
618-
}
620+
}

OSLC4Net_SDK/OSLC4Net.Client/Oslc/Resources/RequirementCollection.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ namespace OSLC4Net.Client.Oslc.Resources;
2525
[OslcNamespace(RmConstants.REQUIREMENTS_MANAGEMENT_NAMESPACE)]
2626
[OslcResourceShape(title = "Requirement Collection Resource Shape",
2727
describes = new string[] { RmConstants.TYPE_REQUIREMENT_COLLECTION })]
28+
[Obsolete("See OSLC4Net.Domains.RequirementsManagement")]
2829
public class RequirementCollection : RequirementBase
2930
{
3031
// The only extra field is uses
@@ -61,4 +62,4 @@ public void SetUses(Uri[] uses)
6162
_uses.Clear();
6263
_uses.AddAll(uses);
6364
}
64-
}
65+
}

OSLC4Net_SDK/OSLC4Net.Client/Oslc/Resources/RmConstants.cs

+5-4
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
namespace OSLC4Net.Client.Oslc.Resources;
1919

20+
[Obsolete("See OSLC4Net.Domains.RequirementsManagement")]
2021
public static class RmConstants
2122
{
2223
public const string REQUIREMENTS_MANAGEMENT_DOMAIN = "http://open-services.net/ns/rm#";
@@ -38,11 +39,11 @@ public static class RmConstants
3839
public const string JAZZ_RM_NAV_NAMESPACE = "http://jazz.net/ns/rm/navigation#";
3940
public const string JAZZ_RM_ACCESS_NAMESPACE = "http://jazz.net/ns/acp#";
4041

41-
public static readonly QName PROPERTY_PRIMARY_TEXT = new QName(RmConstants.JAZZ_RM_NAMESPACE, "primaryText");
42-
public static readonly QName PROPERTY_PARENT_FOLDER = new QName(RmConstants.JAZZ_RM_NAV_NAMESPACE, "parent");
42+
public static readonly QName PROPERTY_PRIMARY_TEXT = new QName(JAZZ_RM_NAMESPACE, "primaryText");
43+
public static readonly QName PROPERTY_PARENT_FOLDER = new QName(JAZZ_RM_NAV_NAMESPACE, "parent");
4344

4445
public static readonly QName PROPERTY_ACCESS_CONTROL =
45-
new QName(RmConstants.JAZZ_RM_ACCESS_NAMESPACE, "accessControl");
46+
new QName(JAZZ_RM_ACCESS_NAMESPACE, "accessControl");
4647

4748
public const string NAMESPACE_URI_XHTML = "http://www.w3.org/1999/xhtml"; //$NON-NLS-1$
48-
}
49+
}

0 commit comments

Comments
 (0)