GithubHelp home page GithubHelp logo

semiodesk / trinity-rdf Goto Github PK

View Code? Open in Web Editor NEW
27.0 6.0 14.0 10.59 MB

Enterprise ready object mapper for developing RDF knowledge graph applications with .NET

License: Other

Batchfile 0.02% C# 99.48% PowerShell 0.51%
csharp knowledge-graph linked-data linked-open-data rdf rdfs owl virtuoso-opensource jena-fuseki

trinity-rdf's Introduction

Overview

Semiodesk Trinity is an application development platform for Microsoft .NET and Mono. It allows to easily build Linked Data and Semantic Web applications based on the RDF metadata standard issued by the W3C. The API allows for developing first-class .NET applications with direct access to Linked Open Data repositories and knowledge graphs.

Our platform is built on top of the powerful and stable dotNetRDF library which has been in development since early 2009. Since dotNetRDF is low-level and primarliy focused on directly manipulating triples, it does not integrate well with existing application frameworks and introduces a steep learning curve for new developers. Therefore, our primary goal was to allow developers to use proven enterprise development patterns such as MVC or MVVM to build Linked Data applications that integrate well into existing application eco-systems.

The software is supported by Semiodesk, for more information have a look at the product page. We are available for consulting and projects, don't hesitate to contact us.

Installation

The easiest way to start using the Trinity API is to add it to your project trough NuGet.

PM> Install-Package Semiodesk.Trinity

Getting Started

After the installation our First Steps guide should help you getting started.

Examples

We have a list of examples to show how easy it is to set up a project.

Documentation

For more details have a look at the API documentation.

Features

Semantic Object Mapping

Similar to OR-mapping techniques for relational databases, we provide a way to map RDFS / OWL terms to .NET objects. Using byte-code manipulation, we implement the code required for the mapping during program compilation. This results in higher performance and less runtime errors than solutions based on introspection.

Ontology Classes

The Trinity platform offers a way to work with ontologies directly in the IDE. We have developed a set of tools to help you integrate ontology concepts directly into your project.

A small code generator transforms RDFS and OWL ontologies into C# representations. With these the IDE, for example Visual Studios IntelliSense, can offer you autocompletion as well as documentation hints for the ontologies you are working with. Additionally this process can be integrated into the build process, that way the code stays up to date with the ontologies.

A different tool deploys the ontologies to your triple store. If you are working on your own ontologies, you can integrate this process into your toolchain.

LINQ

Not familiar with SPARQL? No problem. The powerful LINQ to SPARQL translator in Trinity RDF lets you query your RDF knowledge graph using LINQ.

Data Virtualization

Knowledge graphs can become large datasets quite easily. In order to maintain application performance and user interface responsiveness, Trinity RDF makes paged queries to your datasets easy. Simply use the Take and Skip operators in your LINQ queries and you're done. Of course, SPARQL has built-in support for paging if you are creating more advanced queries.

Various Backends

The Semiodesk Trinity API has built-in support for three store types. We offer an in-memory store to get started quick and without much overhead. For more sophisticated applications we support the use of OpenLinks Virtuoso database. To access data from the Linked Open Data cloud, Trinity is able to connect to SPARQL endpoints. Additional stores can be used trough external modules.

License

The library and tools in this repository are all released under the terms of the MIT license. This means you can use it for every project you like, even commercial ones, as long as you keep the copyright header intact. The source code, documentation and issue tracking can be found at our bitbucket page. If you like what we are doing and want to support us, please consider donating.

Dependencies

The Semiodesk.Trinity API has dependencies to

The libraries are included in the release package. If you install via NuGet the depencies should be resolved for you.

Support

If you need help or want priority support, contact us under [email protected].

trinity-rdf's People

Contributors

darthstem avatar faubulous avatar gboulard avatar joephayes avatar meberl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

trinity-rdf's Issues

Dependency on NetCore although I build for netstandard2.x

Hi :)

I am trying to use Trinity with Unity game engine 2021.3.5, it does not support netcore, it supports netstandard2.1 and net4.6.
I am roughly following the instructions from the homepage and adjusted a few things. So basically I am building a dll with trinity and a datastore inside and access it in unity.

Sadly I get an error when using any function from the built dll:

could not load file or assembly 'System.Private.CoreLib, Version=4.0.0.0

I get this error when targeting net4.6, netstandard2.1 and netstandard2.0 in the Trinity project.

Which seems to mean that the library needs netcore, am I understanding something wrong here? Sharing my .csproj file below.

DataModelV2.zip

(i cant get to xml in a readable format in here, theres nothing special inside, pasting a few interesting lines if you dont want to download the .zip)

  •  <TargetFramework>netstandard2.1</TargetFramework>
    
  • <PackageReference Include="dotNetRDF" Version="2.7.5" />
    
  • <PackageReference Include="Semiodesk.Trinity" Version="1.0.3.70" />
    
  • <PackageReference Include="Newtonsoft.Json" Version="13" />
    

Get Model from Default graph

I followed the example code to hit my own StarDog server and stuck at the following line:

store.GetModel(new Uri(...));

Since all my data is saved under the default graph, what Uri should I passing in?

I believe the the URI will be translate to FROM statement. If I remove the from statement generated from log everything runs fine.

Thanks

dotnet build command fails

Good day, when we try to build a web application for Linux from the Azure pipeline:

We get the following error:
##[error]C:\Users\VssAdministrator.nuget\packages\semiodesk.trinity\1.0.3.50\build\Semiodesk.Trinity.targets(12,5): Error : ICSharpCode.Decompiler.Metadata.AssemblyResolutionException: Failed to resolve assembly: 'Semiodesk.Trinity, Version=1.0.3.50, Culture=neutral, PublicKeyToken=null'
at ICSharpCode.Decompiler.Metadata.UniversalAssemblyResolver.ResolveInternal(IAssemblyReference name)
at ICSharpCode.Decompiler.Metadata.UniversalAssemblyResolver.FindAssemblyFile(IAssemblyReference name)
at ICSharpCode.Decompiler.Metadata.UniversalAssemblyResolver.Resolve(AssemblyNameReference name, ReaderParameters parameters)
at ICSharpCode.Decompiler.Metadata.UniversalAssemblyResolver.Resolve(AssemblyNameReference name)
at Semiodesk.Trinity.CilGenerator.ILGenerator.ProcessFile(String sourceFile, String targetFile)

At the same time, the project is being built and published to Linux from VS just fine.
image

It is possible to reproduce the mentioned behavior:

  1. Checkout trinity examples repo
  2. Run: "C:\Program Files\dotnet\dotnet.exe" build "Examples.sln" -c Release -r linux-x64 -p:ImportByWildcardBeforeSolution=false

Setter of Manually Mapped Property Is Not Propagated Unless Getter Is Accessed

Hello,

I have noticed some pretty unexpected behavior (one might even argue incorrect?) today. We have some manual property mappings (as you describe in your docs here) in our application to represent mappings between enum members and their corresponding RDF named individuals.

In principle, this works quite well, however the following scenario left me a little puzzled:

  • Precondition: Have some model instance in your triple store.
  • Load this instance, update a property that is manually mapped as described above (but without accessing the property getter beforehand or afterwards)
  • Result: It seems that the persisted value has precedence over the just assigned property value - subsequent property get accesses return the previously persisted value. If, however, you execute a Commit() on the resource, property get accesses after a subsequent GetResource<> will yield the correct (i.e., the updated) value (so it was written to the store), but ONLY if there is no get() between the set() and Commit().

I'm afraid this may sound a bit confusing and unclear, therefore I have attached a MWE where one can easily play around with the different outcomes (depending on present or absent get accesses in different successions). It is a modified version of your "First Steps" tutorial, with the newest trinity version and notable changes being:

A micro ontology containing a property that represents the "enum mapping"
<http://www.semanticweb.org/raffa/ontologies/2023/8/enum-test> rdf:type owl:Ontology .

:hasMood rdf:type owl:ObjectProperty ; :range :Mood .

:Mood rdf:type owl:Class ;
      owl:equivalentClass [ rdf:type owl:Class ;
                            owl:oneOf ( :Confused
                                        :Happy
                                        :Sad
                                      )
                          ] .

:Confused rdf:type owl:NamedIndividual , Mood .
:Happy rdf:type owl:NamedIndividual , Mood .
:Sad rdf:type owl:NamedIndividual , Mood .
    <ontology uri="http://www.semanticweb.org/raffa/ontologies/2023/8/enum-test" prefix="enumtest">
      <filesource location="Ontologies/enum-test.ttl"/>
    </ontology>
The custom property mapping
public enum EnMood {    Sad, Happy, Confused   }

[RdfClass(SCHEMA.Person)]
public class Person : Thing {
        private PropertyMapping<Resource> moodMapping = new PropertyMapping<Resource>(nameof(Mood), ENUMTEST.hasMood);

        public EnMood? Mood
        {
            get
            {
                var moodResource = GetValue(moodMapping);
                return moodResource?.Uri.AbsoluteUri switch
                {
                    null => null,
                    ENUMTEST.Sad => EnMood.Sad,
                    ENUMTEST.Happy => EnMood.Happy,
                    ENUMTEST.Confused => EnMood.Confused,
                    _ => throw new ArgumentOutOfRangeException(nameof(moodResource))
                };
            }
            set
            {
                var moodResource = value switch
                {
                    null => null,
                    EnMood.Sad => enumtest.Sad,
                    EnMood.Happy => enumtest.Happy,
                    EnMood.Confused => enumtest.Confused,
                    _ => throw new ArgumentOutOfRangeException(nameof(value), value, null)
                };
                SetValue(moodMapping, moodResource);
            }
        }
}
A small driver program that may be used in different combinations
using Semiodesk.Trinity;
using System;
using System.Reflection;
using FirstSteps.ObjectModel;

namespace FirstSteps
{
    class Program
    {
        private static IModel Model { get; set; }

        static void Main()
        {
            OntologyDiscovery.AddAssembly(Assembly.GetExecutingAssembly());
            MappingDiscovery.RegisterCallingAssembly();

            var store = StoreFactory.CreateStore("provider=dotnetrdf");
            // store.Log = Console.WriteLine;
            Model = store.GetModel(new Uri("http://example.com/model"));
            var johnUri = new Uri("http://example.com/person#john");

            // pretend there's already a User instance in the triple store
            var john = Model.CreateResource<Person>(johnUri);
            john.Mood = EnMood.Happy;
            john.FirstName = "John";
            john.Commit();

            //---------------------------------------------------------------

            // now fetch the User from the database and update it
            var loadedJohn = Model.GetResource<Person>(johnUri);

            // Console.WriteLine("1: " + loadedJohn.Mood + " (expected: Happy)"); // comment out to trigger unexpected results in 2, 3, 4
            // Console.WriteLine("1: " + loadedJohn.FirstName + " (expected: John)"); // expected result in any case
            loadedJohn.Mood = EnMood.Confused;
            loadedJohn.FirstName = "Alice";

            Console.WriteLine("2: " + loadedJohn.Mood + " (expected: Confused)"); // comment out as well to trigger unexpected results only in 3 (and also 4 if the Commit() is commented out)
            Console.WriteLine("2: " + loadedJohn.FirstName + " (expected: Alice)"); // expected result in any case

            loadedJohn.Commit();
            Console.WriteLine("3: " + loadedJohn.Mood + " (expected: Confused)");
            Console.WriteLine("3: " + loadedJohn.FirstName + " (expected: Alice)");

            var loadedJohn2 = Model.GetResource<Person>(johnUri);
            Console.WriteLine("4: " + loadedJohn2.Mood + " (expected: Confused)");
            Console.WriteLine("4: " + loadedJohn2.FirstName + " (expected: Alice)");
        }
    }
}

Keep in mind that there appear no problems with properties that have a "default" mapping, i.e., the tests with the string property FirstName result in the expected behavior in any constellation/setup. You could remove them all.

Furthermore, to test different permutations, simply alternate between commenting in/out the Console.WriteLine calls that access the Person.Mood getter. For your convenience, I have also attached the solution to this issue so that everyone may try it out quickly.

MWE.zip

What is your assessment of this situation? Are we doing anything wrong here or is this, in fact, a bug in trinity?

I very much appreciate your help and king regards,
Raffael

Files are missing in NuGet package of version 1.0.3.68

When downloading the example from trinity-rdf.net on recent Windows versions there is no .NET Core 2.1 installed. However, when upgrading to .NET Core 3.1 the example fails to create resources in the DotNetRDF memory model. When switching to .NET Standard 2.0 the program crashes with the following exception:

Unhandled Exception: System.TypeInitializationException: The type initializer for 'TrinityExample.Program' threw an exception. ---> System.IO.FileNotFoundException: Could not load file or assembly 'Semiodesk.Trinity, Version=1.0.3.68, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
   at TrinityExample.Program..cctor()
   --- End of inner exception stack trace ---
   at TrinityExample.Program.Main()

The problem seems to be that the NuGet package of version 1.0.3.68 is missing the following folders:

  • build
  • tools

This explains why the ontology generator is not working and the CIL generator is not implementing constructors and property accessors.

Include behavior

Good day @ALL, I need to get individuals with a couple of nested properties from a SPARQL endpoint. This code produces an enormous amount of queries (1 + 41 * 3) which tears the productivity down to 20+ seconds for 41 individuals of ExecutableExercise.

        private static void RealLinqTest()
        {
            // Create a temporary memory store.
            IStore store = StoreFactory.CreateSparqlEndpointStore(new Uri("..."));

            // Uncomment to log all executed queries to the console.
            store.Log = (query) => Console.WriteLine(query);

            // A model is where we collect resources logically belonging together
            var model = store.GetModel(new Uri("http://example.com/model"));

            // SPARQL Query [0]
            var executableExercises = model
                .AsQueryable<ExecutableExercise>()
                .Take(50)
                .ToList(); // without ToList() I get an exception on the next line :(
            Console.WriteLine($"------Executables count : {executableExercises.Count()}");

            foreach (var executableExercise in executableExercises)
            {
                // No SPARQL Query
                Console.WriteLine($"------Executable: {executableExercise.Uri}");
                // SPARQL Query [1]
                Console.WriteLine($"------Method: {executableExercise.Method.Uri}");
                // No SPARQL Query 
                Console.WriteLine($"------------Execution: {executableExercise.Method.ExecutionString}");
                // SPARQL Query [2]
                Console.WriteLine($"------Equipment: {executableExercise.Equipment.Uri}");
                // SPARQL Query [3]
                Console.WriteLine($"------Exercise: {executableExercise.Exercise.Uri}");
            }

            Console.WriteLine();
            Console.WriteLine("Press ANY key to close..");
            Console.ReadLine();
        }
    }

Is there a way to improve performance? Like, include or eager loading in EF?

Models
   // SCHEMA is a custom ontology consistent and coherent (according to Protege )
  
    [RdfClass(SCHEMA.Exercise)]
    public class Exercise : Resource
    {
        [RdfProperty(RDFS.label), NotifyPropertyChanged]
        public string Label { get; set; }

        public Exercise(Uri uri) : base(uri)
        {
        }
    }

    [RdfClass(SCHEMA.ExecutableExercise)]
    public class ExecutableExercise: Resource
    {
        [RdfProperty(SCHEMA.usesEquipment), NotifyPropertyChanged] 
        public Equipment Equipment { get; set; }
        
        [RdfProperty(SCHEMA.usesExercise)] 
        public Exercise Exercise { get; set; }

        [RdfProperty(SCHEMA.usesMethod)]
        public Method Method { get; set; }

        public ExecutableExercise(Uri uri) : base(uri)
        {
        }
    }

    [RdfClass(SCHEMA.Equipment)]
    public class Equipment : Resource
    {
        [RdfProperty(RDFS.label), NotifyPropertyChanged]
        public string Label { get; set; }

        public Equipment(Uri uri) : base(uri)
        {
        }
    }

    [RdfClass(SCHEMA.Method)]
    public class Method : Resource
    {
        [RdfProperty(SCHEMA.hasExecutionString), NotifyPropertyChanged]
        public string ExecutionString { get; set; }

        public Method(Uri uri) : base(uri)
        {
        }
    }

I can only seem to connect to stardog on localhost

When I use trinityRDF to connect to stardog running on localhost I can query it and all works well. When however I connect to a server on a remote machine (on the same network) I get an error:

A HTTP error occurred while beginning a Transaction in the Store. No response, see aforementioned status line or inner exception for further details

Inner exception:

A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

I can connect to the remote instance of stardog using other libraries or stardog studio. If I stand up an instance of stardog on localhost and alter the connection string to match I can also connect to it.

The dysfunctional connection string is: "provider=stardog;host=http://192.168.221.121:5820;uid=admin;pw=admin;sid=music";
The working connection string is: "provider=stardog;host=http://localhost:5820;uid=admin;pw=admin;sid=music"

In order as to elminate as many sources of error as possible I've recreated this in the stardog "TrinityConsoleSample" sample code from stardog.

I've asked this on stackoverflow too, but this might be a more appropriate place.

Error thrown by LINQ query

Trinity-RDF version 1.0.3.29

Given the following code:

            const int PAGE_SIZE = 4;
            const int MAX_NUMBER_OF_PAGES = 8;

            var allBands = Model.AsQueryable<Band>()
                                .OrderBy((b) => b.Name);

            // loop through pages of bands

            for (int n = 0; n < MAX_NUMBER_OF_PAGES; n++)
            {
                Console.WriteLine($"Fetching {PAGE_SIZE} bands from page {n + 1}...");

                foreach (Band b in allBands.Skip(n * PAGE_SIZE).Take(PAGE_SIZE))
                {
                    Console.WriteLine($"Band: {b.Name}");

                    foreach (SoloArtist sa in b.Members)
                    {
                        Console.WriteLine($"\tMember: {sa.Name}");
                    }
                }
            }

An exception is thrown by the line foreach (SoloArtist sa in b.Members). Exception message and stacktrace is:

VDS.RDF.Query.RdfQueryException: "A HTTP error (HTTP 400 Bad Request) occured while querying the Store.\nStore returned the following error message: {\"message\":\"com.complexible.stardog.plan.eval.ExecutionException: Encountered \\\" <NIL> \\\"( ) \\\"\\\" at line 1, column 78.\\nWas expecting one of:\\n    \\\"(\\\" ...\\n    \\\"if\\\" ...\\n    \\\"tz\\\" ...\\n    \\\"md5\\\" ...\\n    \\\"str\\\" ...\\n    \\\"abs\\\" ...\\n    \\\"day\\\" ...\\n    \\\"now\\\" ...\\n    \\\"IRI\\\" ...\\n    \\\"URI\\\" ...\\n    \\\"ceil\\\" ...\\n    \\\"year\\\" ...\\n    \\\"sha1\\\" ...\\n    \\\"uuid\\\" ...\\n    \\\"lang\\\" ...\\n    \\\"rand\\\" ...\\n    \\\"regex\\\" ...\\n    \\\"bound\\\" ...\\n    \\\"ucase\\\" ...\\n    \\\"lcase\\\" ...\\n    \\\"floor\\\" ...\\n    \\\"isIRI\\\" ...\\n    \\\"isURI\\\" ...\\n    \\\"month\\\" ...\\n    \\\"hours\\\" ...\\n    \\\"bnode\\\" ...\\n    \\\"strdt\\\" ...\\n    \\\"strlen\\\" ...\\n    \\\"substr\\\" ...\\n    \\\"concat\\\" ...\\n    \\\"sha224\\\" ...\\n    \\\"sha256\\\" ...\\n    \\\"sha384\\\" ...\\n    \\\"sha512\\\" ...\\n    \\\"exists\\\" ...\\n    \\\"minutes\\\" ...\\n    \\\"seconds\\\" ...\\n    \\\"isBlank\\\" ...\\n    \\\"strAfter\\\" ...\\n    \\\"replace\\\" ...\\n    \\\"strlang\\\" ...\\n    \\\"struuid\\\" ...\\n    \\\"strEnds\\\" ...\\n    \\\"datatype\\\" ...\\n    \\\"sameTerm\\\" ...\\n    \\\"timezone\\\" ...\\n    \\\"contains\\\" ...\\n    \\\"coalesce\\\" ...\\n    \\\"not exists\\\" ...\\n    \\\"strStarts\\\" ...\\n    \\\"strBefore\\\" ...\\n    \\\"isLiteral\\\" ...\\n    \\\"isNumeric\\\" ...\\n    \\\"langmatches\\\" ...\\n    \\\"encode_for_URI\\\" ...\\n    <Q_IRI_REF> ...\\n    <PNAME_NS> ...\\n    <PNAME_LN> ...\\n    <FUNCTION_NAME> ...\\n    \",\"code\":\"QE0PE2\"}\nSee aforementioned status line or inner exception for further details" ---> System.Net.WebException: "The remote server returned an error: (400) Bad Request."
  at at System.Net.HttpWebRequest.GetResponse()\n   at VDS.RDF.Storage.BaseStardogConnector.Query(IRdfHandler rdfHandler, ISparqlResultsHandler resultsHandler, String sparqlQuery, Boolean reasoning)
  --- End of inner exception stack trace ---
  at VDS.RDF.Storage.BaseStardogConnector.Query(IRdfHandler rdfHandler, ISparqlResultsHandler resultsHandler, String sparqlQuery, Boolean reasoning)\n   at Semiodesk.Trinity.Store.Stardog.StardogStore.ExecuteQuery(ISparqlQuery query, ITransaction transaction)\n   at Semiodesk.Trinity.Model.<GetResources>d__38.MoveNext()\n   at Semiodesk.Trinity.ResourceCache.LoadCachedValues(IPropertyMapping mapping)\n   at Semiodesk.Trinity.Resource.GetValue[T](PropertyMapping`1 propertyMapping)\n   at ConsoleSample.Program.Main(String[] args) in /Users/jhayes/dev/grundfos/dotNetSample/ConsoleSample/Program.cs:95

The generated SPARQL looks like this:

SELECT ?s ?p ?o FROM <http://stardog.com/tutorial> WHERE { ?s ?p ?o . FILTER ( ) ?s = <http://stardog.com/tutorial/Mark_Herndon> || ?s = <http://stardog.com/tutorial/Jeff_Cook> || ?s = <http://stardog.com/tutorial/Randy_Owen> }

This same code worked with version 1.0.3.28

Regex support is broken

Regex pattern is appended with "$" end of the line. Which makes it impossible to construct a pattern for regex.IsMatch.

How to work with localized labels: best practice

Good day, I think documentation doesn't cover one important issue: what are best practices working with properties that have localized values?

now I'm describing all resources inherited from this one, and that suits me well, except I'd like to use Tuple<String, String> descendant to have a more self-explanatory object, but this feature is tightly coupled to a specific class.

    public class LabeledResource: BaseResource
    {

        // don`t use private, Trinity will not understand that in descendant resource.
        protected readonly PropertyMapping<List<Tuple<string, string>>> LabelMapping = new("Labels", rdfs.label);
        public List<Tuple<string, string>> Labels
        {
            get => GetValue(LabelMapping);
            set => SetValue(LabelMapping, value);
        }
        public LabeledResource(UriRef uri) : base(uri)
        {
        }

        public LabeledResource(Uri uri) : base(uri)
        {
        }

        public LabeledResource(string uriString) : base(uriString)
        {
        }

        public LabeledResource(Resource other) : base(other)
        {
        }
    }

Switch automatic Ontologies.g.cs generation off

The autogeneration behavior produces a lot of pitfalls during CI/CD pipelines, as follows:

##[error]Domain\OntologyResources\Focus.cs(13,1): error : R# Ambiguous reference:
OymOntology.oym
OymOntology.oym

Though I definitely know that my Ontologies.g.cs is consistent and OymOntology.oym class was not ambiguous when pushed to Git.

Steps to reproduce:

  1. Download and unzip free ReSharper command line tools: https://www.jetbrains.com/resharper/download/#section=commandline
  2. run command from unpacked folder (change path to solution of yours):

inspectcode "d:\trinity-rdf-examples\core-example\core-example.csproj" /o:"output.xml" --properties:Configuration=Release --no-build --verbosity=info

  • Expected: Produced output.xml shouldn't contain any CSharpErrors (otherwise code is considered faulty and not accepted as valid PR),
  • Actual: Many errors like
     <Issue TypeId="CSharpErrors" File="ObjectModel\Drug.cs" Offset="1667-1673" Line="37" Message="Ambiguous reference:&#xD;&#xA;  Semiodesk.Example.SCHEMA&#xD;&#xA;  Semiodesk.Example.SCHEMA&#xD;&#xA;match" />
     <Issue TypeId="CSharpErrors" File="ObjectModel\Drug.cs" Offset="1910-1916" Line="45" Message="Ambiguous reference:&#xD;&#xA;  Semiodesk.Example.SCHEMA&#xD;&#xA;  Semiodesk.Example.SCHEMA&#xD;&#xA;match" />
     <Issue TypeId="CSharpErrors" File="ObjectModel\Drug.cs" Offset="2016-2022" Line="49" Message="Ambiguous reference:&#xD;&#xA;  Semiodesk.Example.SCHEMA&#xD;&#xA;  Semiodesk.Example.SCHEMA&#xD;&#xA;match" />

It is very hard to say what exactly causes this issue, I can only assume that R# builds the project and ontologies.g.cs become dirty after that (same command with --verbosity=verbose > output.log contains on a log file:

MsBuild [ProjectModel] Process 26244: Starting ontology generator in d:\work\OYM_files\trinity\trinity-rdf-examples\core-example

Is it possible to switch off auto-generation of Ontologies.g.cs?

Is it mandatory to use attributes for resources description?

When I use resources that have no [RdfClass] attribute like Model.AsQueryable<R>.Skip(0).Take(5).ToList; I get an exception:

[DotToken at Line 1 Column 129 to Line 1 Column 130] Unexpected DOT in graph pattern.

Note: I used alternative method to describe resources, overriding GetType and assigning MappingProperty<>.

Generated SPARQL query is missing the part where SPO is filtered against RDF type:

I've pushed some test code in my fork:
branch: https://github.com/IgorKaplya/trinity-rdf/tree/SPARQL-not-generated-without-attribute
fixture: LinqTestBase
test: CanSelectResourcesWithAsQueryableWithoutAttributes

For now I have to use both: Attribute and the approach with GetType().

UpdateResource fix required

In order to update a resource, the user should not manually mark their resource with "Resource.IsNew = false;" but should be automatically handled by the business logic.

Furthermore, UpdateResource should only change one variable without affecting all the others as the problem is detailed in these screenshots below:

picturemessage_nb2vagmz 1va
picturemessage_hmronuso nsz
picturemessage_o2tbpzj3 sop

Maybe changing the SPARQL Update Query, so that it explicitly contains the variable name/range in the predicate would fix the problem mentioned above.

Thank you!

Upgrade to newer version of dotNetRDF?

Hello,

the Trinity packages (e.g., Semiodesk.Trinity, Semiodesk.Trinity.Graphdb) reference dotNetRDF in version 2.7.0. As of today, the most current version is 3.1.0 (see https://dotnetrdf.org/ and https://dotnetrdf.org/2023-09-10-dnr-3-1-0-released/).

Of course, there are some breaking changes, but the majority of migrations needed to upgrade to 3.0 (or now 3.1) are not overly complex. This is at least true for an application that I have been part of. I am only somewhat familiar with TrinityRdf's source code, so I cannot make absolute statements about that. But we have migrated to the newest version once and it was manageable. However, we needed to rollback/downgrade back to version 2.7 when we adopted TrinityRdf.

While this has been working pretty well for us, especially since there is in-built GraphDB support, I would like to know: Is upgrading to the newest version of dotNetRDF on your roadmap? If not, is there any particular, technical, reason for it or is there anything else that prevents you from doing so (apart from time- und budget reasons, of course, which are absolutely understandable)?

Kind regards,
Raffael

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.