Coder Social home page Coder Social logo

mdesalvo / owlsharp Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 0.0 2.44 MB

Lightweight and friendly .NET library for realizing intelligent Semantic Web applications

License: Apache License 2.0

C# 100.00%
ontology owl owl-dl owl2 reasoner rdfs inference-engine geosparql owl-time skos skos-xl swrl

owlsharp's Issues

Validation with cardinality restriction

Hi Marco,

here are two simple examples of inconsistent ontology:
CardinalityTest1.ttl.txt
CardinalityTest0.ttl.txt

OWLValidator does not report the inconsistency:

OWLOntology ontology = OWLOntology.FromRDFGraph(RDFGraph.FromFile(RDFModelEnums.RDFFormats.Turtle, filepath));
OWLValidator validator = new();
foreach (OWLEnums.OWLValidatorRules rule in Enum.GetValues(typeof(OWLEnums.OWLValidatorRules)))
    validator.AddRule(rule);
OWLValidatorReport report = validator.ApplyToOntology(ontology);
Console.WriteLine(report.EvidencesCount); // writes 0 here

Add ability to query an ontology with SPARQL

Provide a way to query an ontology with a SPARQL SELECT query. It is also nice to have the ability to give a reasoner in order to expand the knowledge with eventual inferences.

Reasoner error?

Hi Marco,
here are the steps:

  1. The ontology is made from the graph:
ex:DescendantOf rdf:type owl:ObjectProperty .
ex:ParentOf rdf:type owl:ObjectProperty .

ex:ParentOf rdfs:subPropertyOf [ owl:inverseOf ex:DescendantOf ] .

ex:iJunior rdf:type owl:NamedIndividual .
ex:iMajor rdf:type owl:NamedIndividual .
ex:iMajor ex:ParentOf ex:iJunior .
  1. The reasoner with single rule is applied to ontology:
var report = new OWLReasoner().AddRule(OWLEnums.OWLReasonerRules.PropertyEntailment).ApplyToOntology(ontology);
  1. The following error occurs:
    Cannot create RDFTriple because given "pred" parameter is a blank resource

Other well-known reasoners handle this properly.

SKOS extension should conform to our standard architecture (like SWRL, GEO and TIME)

SKOS extension was originally developed with its own set of powerful DTOs, centered all around on SKOSConceptScheme. It should be redesigned to adhere to our standard architecture for extensions, like SWRL (starting from v3.9), GEO and TIME. A true extension layer not introducing or relying on own objects, just focused on OWLOntology and what matters for SKOS programming.

Add ability to import ontologies

Provide a "Import(RDFResource)" method to OWLOntology, which makes it possible to import remote ontologies by Uri-dereference. This is a fundamental option for the daily operativity of ontologists!

It should also be possible to merge models in a way "void Merge(model)" and also datas in a way "void Merge(data)". Give ontologists chances to really do knowledge mashups.

Also provide reasoner rule for inverse functional entailment

In #7 we added FunctionalEntailment reasoner rule. We can easily apply the same literature trick to build an InverseFunctionalEntailment rule: if the same individual is reached by an IF object property, then the source individuals can be inferred to be the same (if compatible).

Functional properties, SameAs inference, validation

Hello,
I am not sure this is the best channel to ask this question...
I am a researcher at NORCE, and I am building an ontology to describe some industrial real-time signals. I have been using your packages for some time now, it is quite a beautiful work you've done!
Here is my question: I have a functional property (myProperty).
When I declare two assertions of this property for a single resource:

  • myResource myProperty resource1
  • myResource myProperty resource2
    I would expect a reasoner to infer that resource1 and resource2 are the same (resource1 SameAs resource2). This is the behavior described in many textbooks.
    I couldn't tune the reasoner to achieve this. So I created a custom rule (so far only valid for myProperty since it seems that custom rules can't apply to variable properties). It basically says: if q myProperty r1 AND q myProperty r2, THEN r1 SameAs r2.
    This works fine. But when trying to validate the ontology, the functional property rule is broken: there are 2 property assertions, even if they are the same.
    So:
  • is there a way (nicer than what I did) to infer the sameas property in my situation?
  • is there a way to enforce the validation to consider SameAs properties, and therefore not react in my situation?

Sorry for the long message, and again the library is a charm to use!
Regards,
Benoit Daireaux

Modeling support for "Negative Type" statement

Hi Marco!
Let there be an individual I0 and a class C0 in the ontology.
What is the optimal way to check, is there an explicit statement that individual I0 does not belong to class C0?
It must be expressed as belongness to "complementOf C0".
There is the method "CheckHasCompositeClass", but it mixes three different kinds of composite class expressions.

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.