IntoRdf 1.1.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package IntoRdf --version 1.1.0                
NuGet\Install-Package IntoRdf -Version 1.1.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="IntoRdf" Version="1.1.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add IntoRdf --version 1.1.0                
#r "nuget: IntoRdf, 1.1.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install IntoRdf as a Cake Addin
#addin nuget:?package=IntoRdf&version=1.1.0

// Install IntoRdf as a Cake Tool
#tool nuget:?package=IntoRdf&version=1.1.0                

IntoRdf

IntoRdf is a NuGet package for transforming Excel (XLSX) files into RDF (Resource Description Framework) format. This package helps developers easily convert spreadsheet data into RDF triples using a simple and convenient API.

Features

Transform Excel (XLSX) files into Turtle or JSON-LD RDF formats. Easily define custom namespaces and predicates for RDF individuals. Supports various spreadsheet configurations, such as different sheet names, header rows, and data rows/columns.

Installation

Install the IntoRdf NuGet package using the following command:

dotnet install IntoRdf

Usage

To use IntoRdf, import the following namespaces:

using IntoRdf;
using IntoRdf.Models;

Create an instance of ITransformerService to transform spreadsheets into RDF:

ITransformerService transformerService = new TransformerService();

Then, create SpreadsheetDetails and TransformationDetails objects to define the input spreadsheet structure and the desired RDF output:

var spreadsheetDetails = new SpreadsheetDetails(sheetName: "Sheet1", headerRow: 1, dataStartRow: 2, startColumn: 1);

var transformationDetails = new TransformationDetails(
    baseUri: new Uri("http://example.com/"),
    predicateBaseUri: new Uri("http://example.com/predicates/"),
    IdentifierSegment: new TargetPathSegment("id", "identifier"),
    targetPathSegments: new List<TargetPathSegment> { new TargetPathSegment("name", "name") },
    outputFormat: RdfFormat.Turtle
);

Finally, call the TransformSpreadsheet method to perform the transformation:

using var stream = new MemoryStream(Encoding.UTF8.GetBytes(spreadsheetContent));
string rdfOutput = transformerService.TransformSpreadsheet(spreadsheetDetails, transformationDetails, stream);

API Reference

ITransformerService

TransformSpreadsheet(SpreadsheetDetails spreadsheetDetails, TransformationDetails transformationDetails, Stream content)

Transforms the input spreadsheet into RDF format based on the provided transformation details.

SpreadsheetDetails

SpreadsheetDetails(string sheetName, int headerRow, int dataStartRow, int startColumn)

Constructor to create a new SpreadsheetDetails object.

  • sheetName: The name of the sheet containing the data in the input spreadsheet.
  • headerRow: The row number containing the column headers in the input spreadsheet (1-based index).
  • dataStartRow: The row number where the data starts in the input spreadsheet (1-based index).
  • startColumn: The column number where the data starts in the input spreadsheet (1-based index).

TransformationDetails

TransformationDetails(Uri baseUri, Uri predicateBaseUri, TargetPathSegment? IdentifierSegment, List<TargetPathSegment> targetPathSegments, RdfFormat outputFormat)

Constructor to create a new TransformationDetails object.

  • baseUri: The base URI for creating RDF individuals.
  • predicateBaseUri: The base URI for creating RDF predicates.
  • IdentifierSegment: An optional TargetPathSegment for the identifier of RDF individuals. If specified, the subjects for the resulting RDF triples will be created using baseUri + segment + value in the cell gotten from the column matching target. If not specified, the subjects will be created using baseUri + a GUID.
  • targetPathSegments: A list of TargetPathSegment objects to define the RDF individuals' properties.
  • outputFormat: The desired RDF format for the output (Turtle, Trig, or JSON-LD).

TargetPathSegment

TargetPathSegment(string target, string segment)

Constructor to create a new TargetPathSegment object.

  • target: The property name of the literal to turn into an RDF individual. When transforming a spreadsheet, this will refer to a column name.
  • segment: The URI segment to append to the base URI, enabling the creation of specific namespaces for different individuals.

RdfFormat

Enum with the following values: Turtle, Trig, Jsonld

Changelog

For a detailed list of changes in each version, please refer to the CHANGELOG file.

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.1.6 431 10/23/2024
2.1.5 76 10/23/2024
2.1.2 747 8/30/2024
2.0.9 858 8/7/2024
2.0.8 106 8/7/2024
2.0.7 102 8/7/2024
2.0.6 124 8/7/2024
2.0.5 99 8/7/2024
2.0.4 109 8/7/2024
2.0.3 740 7/11/2024
2.0.2 87 6/18/2024
2.0.1 589 6/3/2024
2.0.0 2,504 4/30/2024
1.1.4 401 4/15/2024
1.1.4-prerelease 106 4/15/2024
1.1.3 435 4/3/2024
1.1.2 542 3/18/2024
1.1.1 128 3/15/2024
1.1.0 1,599 1/18/2024
1.0.0 1,090 11/23/2023
0.3.6 123 10/11/2023
0.3.4 4,401 6/26/2023
0.3.3 152 5/11/2023
0.3.2 135 5/8/2023
0.3.1 1,456 5/2/2023
0.3.0 163 4/14/2023
0.2.1 171 4/12/2023
0.2.0 761 3/30/2023
0.1.0 212 3/29/2023
0.0.1 205 3/23/2023

# Changelog

## [0.4.3](https://github.com/equinor/into-rdf/compare/v0.4.2...v0.4.3) (2024-01-18)


### Other

* **deps:** bump xunit from 2.5.1 to 2.6.6 ([#113](https://github.com/equinor/into-rdf/issues/113)) ([7cbdf4f](https://github.com/equinor/into-rdf/commit/7cbdf4f3be4b8ae674dcd574617e53106174918e))

## [0.4.2](https://github.com/equinor/into-rdf/compare/v0.4.1...v0.4.2) (2024-01-18)


### Other

* **deps:** bump Spectre.Console from 0.47.0 to 0.48.0 ([#104](https://github.com/equinor/into-rdf/issues/104)) ([d24587b](https://github.com/equinor/into-rdf/commit/d24587bab45f55ec960bd229c769196e09234a76))
* **deps:** bump xunit.runner.console from 2.5.1 to 2.6.6 ([#114](https://github.com/equinor/into-rdf/issues/114)) ([07b0f52](https://github.com/equinor/into-rdf/commit/07b0f521b25c7221ac26d891c21187d58d6fff07))
* **deps:** bump xunit.runner.visualstudio from 2.5.1 to 2.5.6 ([#109](https://github.com/equinor/into-rdf/issues/109)) ([6f70c52](https://github.com/equinor/into-rdf/commit/6f70c52cc626c40ac489e84440a84a4e483140d5))

## [1.0.0](https://github.com/equinor/into-rdf/compare/v0.4.0...v0.4.1) (2023-11-23)


### Other

* trigger release please ([#102](https://github.com/equinor/into-rdf/issues/102)) ([978868b](https://github.com/equinor/into-rdf/commit/978868b5d866e9c44b06dd6070d9ba9113675fe0))

## [1.0.0](https://github.com/equinor/into-rdf/compare/v0.3.7...v0.4.0) (2023-11-22)


### Features

* Validation intoRDF ([#99](https://github.com/equinor/into-rdf/issues/99)) ([4c8c063](https://github.com/equinor/into-rdf/commit/4c8c0637a726c4183ac2942cf3c33b27f450b755))

## [0.3.7](https://github.com/equinor/into-rdf/compare/v0.3.6...v0.3.7) (2023-11-21)


### Documentation

* Initial handover document ([#71](https://github.com/equinor/into-rdf/issues/71)) ([a3b9507](https://github.com/equinor/into-rdf/commit/a3b950720d9803513097aa80fa71c9ec967412e1))

## [0.3.6](https://github.com/equinor/into-rdf/compare/v0.3.5...v0.3.6) (2023-10-11)


### Other

* Upgrade githb action setup dotnet to v3 ([#78](https://github.com/equinor/into-rdf/issues/78)) ([a10902e](https://github.com/equinor/into-rdf/commit/a10902ed9fbd2adebe5151441cfb18b402b7f2c7))

## [0.3.5](https://github.com/equinor/into-rdf/compare/v0.3.4...v0.3.5) (2023-10-11)


### Other

* fix indentation ([#76](https://github.com/equinor/into-rdf/issues/76)) ([e29bfca](https://github.com/equinor/into-rdf/commit/e29bfca81775f49454364855c6595dcda19c1eb7))
* Remove sync csproj step ([#74](https://github.com/equinor/into-rdf/issues/74)) ([707efc0](https://github.com/equinor/into-rdf/commit/707efc0318ee54b91f4e48a6bd21f75d69c82fde))
* small change to trigger release please ([#73](https://github.com/equinor/into-rdf/issues/73)) ([09b3b13](https://github.com/equinor/into-rdf/commit/09b3b13499734fedc040b782df8753311461f58e))
* Upgraded available nuget packages ([#72](https://github.com/equinor/into-rdf/issues/72)) ([c635635](https://github.com/equinor/into-rdf/commit/c63563596f58e21672bd3e611f20a4d7575f4d05))


### CI/CD

* Update release please ([#75](https://github.com/equinor/into-rdf/issues/75)) ([f37cc23](https://github.com/equinor/into-rdf/commit/f37cc23ee734b24d9720225511f59151a78bc748))

## [0.3.4](https://github.com/equinor/into-rdf/compare/v0.3.3...v0.3.4) (2023-06-26)


### Bug Fixes

* add option to custom escape certain chars ([#66](https://github.com/equinor/into-rdf/issues/66)) ([ac6c523](https://github.com/equinor/into-rdf/commit/ac6c52348fd839d8b301d00c1949186c39d3f223))

## [0.3.3](https://github.com/equinor/into-rdf/compare/v0.3.2...v0.3.3) (2023-05-10)


### Bug Fixes

* trailing slash bug ([#57](https://github.com/equinor/into-rdf/issues/57)) ([54c3ae1](https://github.com/equinor/into-rdf/commit/54c3ae188c0e40e52a604335d4e4fa7be329be4d))

## [0.3.2](https://github.com/equinor/into-rdf/compare/v0.3.1...v0.3.2) (2023-05-04)


### Bug Fixes

* selecting correct data rows ([#55](https://github.com/equinor/into-rdf/issues/55)) ([f3f2d7c](https://github.com/equinor/into-rdf/commit/f3f2d7cbab1544614675a85b71be621dd2ecc9e7))

## [0.3.1](https://github.com/equinor/into-rdf/compare/v0.3.0...v0.3.1) (2023-05-02)


### Bug Fixes

* remove BOM at the start of jsonld ([#53](https://github.com/equinor/into-rdf/issues/53)) ([97da9dd](https://github.com/equinor/into-rdf/commit/97da9dd97cdbd04db45ffb851bc1285ccbbad453))

## [0.3.0](https://github.com/equinor/into-rdf/compare/v0.2.1...v0.3.0) (2023-04-14)


### ⚠ BREAKING CHANGES

* Functions that where previously part of the interface is now removed

### Miscellaneous Chores

* remove ontology and record from interface ([#50](https://github.com/equinor/into-rdf/issues/50)) ([0f98076](https://github.com/equinor/into-rdf/commit/0f9807603fe72f9b13fdc9b1ce7354c9d5fb6632))

## [0.2.1](https://github.com/equinor/into-rdf/compare/v0.2.0...v0.2.1) (2023-04-12)


### Features

* add support for csv ([#42](https://github.com/equinor/into-rdf/issues/42)) ([c532398](https://github.com/equinor/into-rdf/commit/c5323982fd01ca56e662bd2c12b017780ad2ebac))
* Make end-column optional ([#41](https://github.com/equinor/into-rdf/issues/41)) ([e7fe5c3](https://github.com/equinor/into-rdf/commit/e7fe5c36883eda31ce85196e67b5ac9cc025a686))

## [0.2.0](https://github.com/equinor/into-rdf/compare/v0.1.0...v0.2.0) (2023-03-30)


### ⚠ BREAKING CHANGES

* ns IntoRdf.Public -> IntoRdf ([#38](https://github.com/equinor/into-rdf/issues/38))

### Features

* ns IntoRdf.Public -&gt; IntoRdf ([#38](https://github.com/equinor/into-rdf/issues/38)) ([a1eeb32](https://github.com/equinor/into-rdf/commit/a1eeb321e5b47e44b281cffc8a9c888e86305586))

## 0.1.0 (2023-03-29)


### Features

* add cli and fix lowhanging fruits ([#7](https://github.com/equinor/into-rdf/issues/7)) ([cd0eeee](https://github.com/equinor/into-rdf/commit/cd0eeeee0a5ec43ae4e60e965dfbd58c49f8557a))
* Add public endpoint ([#4](https://github.com/equinor/into-rdf/issues/4)) ([26d91f2](https://github.com/equinor/into-rdf/commit/26d91f21ff27c71a9012e322d898777203b57db1))
* do proper escaping of all URLs ([#13](https://github.com/equinor/into-rdf/issues/13)) ([ca23794](https://github.com/equinor/into-rdf/commit/ca23794fd8b650044026c0cf992e93c29df5e127))
* Split spreadsheet and transformation details ([#6](https://github.com/equinor/into-rdf/issues/6)) ([9812645](https://github.com/equinor/into-rdf/commit/98126457c0ffaeefdeecf5f452ac35a42aa92caf))


### Bug Fixes

* correct handling of empty cells ([#19](https://github.com/equinor/into-rdf/issues/19)) ([4941f24](https://github.com/equinor/into-rdf/commit/4941f24f66a2e66144cf1017defd059fa92da318))
* make into rdf compile ([#2](https://github.com/equinor/into-rdf/issues/2)) ([312f4c4](https://github.com/equinor/into-rdf/commit/312f4c4b8d224a2e22db5de042186067337c4efc))