Kumo 0.3.1

dotnet add package Kumo --version 0.3.1
NuGet\Install-Package Kumo -Version 0.3.1
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="Kumo" Version="0.3.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Kumo --version 0.3.1
#r "nuget: Kumo, 0.3.1"
#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 Kumo as a Cake Addin
#addin nuget:?package=Kumo&version=0.3.1

// Install Kumo as a Cake Tool
#tool nuget:?package=Kumo&version=0.3.1

Kumo

Enriching Microsoft Word documents with semantic annotations.

Kumo Icon

What is Kumo?

Kumo is a semantic annotation library that enables the user to easily specify relationships between text fragments within a document and places, concepts, people, dates and other things that may be stored in an ontology. This is accomplished by providing a simple way to create a relationship and apply it to one or more text fragments within the document.

Getting started

The library is available at NuGet: https://www.nuget.org/packages/Kumo/

To get the latest version of the library, clone this repository and reference the project under src/Kumo in your solution.

Examples

Please note that the library is work in progress.

Some features are yet to be implemented, while others may contain major bugs.

The library API is still subject to change.

The examples here demonstrate some of the basic functionality.

The following code snippet opens a document and retrieves a text fragment.

using System;
using Kumo;

using (var d = Document.Open("path/to/document.docx"))
{
    var text = d.Range(0, 42).Text();

    Console.WriteLine(text);
}

To annotate a text fragment, one must create a Property object which represents an edge with node connected to it in a knowledge graph.

using System;
using Kumo;

using (var d = Documents.Open("path/to/document", true))
{
    var r = d.Range(0, 42);

    r.Attach(
        new Property(
            new("http://example.org/rel"),
            new Resource.Unique("http://example.org/val")
        )
    );
}

You can also attach multiple properties at once to a range.

using System;
using Kumo;

using var d = Documents.Open("path/to/document", true);
{
    var propertyName = new Uri("https://example.orh/references");
    
    var pA = new Property(
        propertyName,
        new Resource.Unique("https://example.org/A")
    );

    var pB = new Property(
        propertyName,
        new Resource.Unique("https://example.org/B")
    );

    var pC = new Property(
        propertyName,
        new Resource.Unique("https://example.org/C")
    );

    var r = d.Range(0, 5);

    r.Attach(new Property[] { pA, pB, pC });
}

Accessing all annotated text fragments within a document is simple.

using System;
using Kumo;

using (var d = Document.Open("path/to/document.docx"))
{
    // Yes, they are called stars.
    var stars = d.Stars();

    foreach (var s in stars)
    {
        Console.WriteLine(s.Text());
    }
}
Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  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
0.3.1 352 6/16/2021
0.3.0 283 6/16/2021
0.2.0-alpha-with-xml-docs 201 4/21/2021
0.2.0-alpha 201 4/21/2021

Fixed a bug with UriFormatException being thrown when attempting to attach a property
to a range in a fresh document on Windows.