Giter VIP home page Giter VIP logo

Comments (2)

caufieldjh avatar caufieldjh commented on June 4, 2024

Hi @serenalotreck - that last PR doesn't actually add any support for n-ary relations, but you're right, it's still making a lot of assumptions about binary relations. Some objects with multiple attributes may not be relations, though, and the schemas intentionally don't require that level of modeling detail to be defined.

If I have a Drug class with the attributes brand_name and approval_status where both are strings, I could assume that all Drug objects should be translated to relations where brand_name and approval_status will be subject and object, respectively - but that may not be the intended model at all. Same for additional fields: if I have another field like updated_on then should that be a node property? An edge property? Probably not a predicate type but I don't really know that by the name alone.

We could just assume that everything is a triple, like in RDF, but that may defeat the purpose of LinkML, plus it's kind of messy.
So I'll propose a hybrid solution for now:

  • If attributes are explicitly named subject, predicate, and object, they will be treated accordingly
  • predicate may or may not be present - if not, use class name
  • Otherwise, assume dicts of 1:1 key:value pairs are triples

This is a workaround. I will accept your changes in the linked PR then open another issue+PR to add the above solution, enabling other predicate parsing cases.

There's a more elegant solution here in which the annotations field can accept explicit directions for what should be subject, predicate, object, etc. - I'll open up another ticket for that.

from ontogpt.

serenalotreck avatar serenalotreck commented on June 4, 2024

Awesome, thanks so much!

from ontogpt.

Related Issues (20)

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.