Ontology creation - Subclass or definable? - ontology

I am creating an ontology on groups and events they have. So I have a class for group, events and person, there are different kinds of groups and there are different types of events e.g. a skiing group would have social events, a physics group has educational events etc. A person can be a member of a group. I'm new to creating ontologies so forgive me but I want to know if having different groups should be a subclass of group or to have this as dataproperties of group? Same case with Events class.
Thanks a lot

Related

In Neo4j, is it possible to have the same relationship name for different entities

Let`s use the movie DB as an example.
If I would insert all people that worked on a movie in the DB, it would be difficult to find relationship names for everyone. Would it be a problem to have entities like: sound_designer, sound_engineer, set_designer, set_assistance, cable_guy, etc with the same relationship "WORKS_IN" to a Movie entity. Is it possible? Is it a good solution? Would I have problems? Are there alternatives?
Gabor's answer in the comments is a good one, there are no problems with nodes of differing labels having relationships of the same type to the same node.
Multi-labeling nodes with their role isn't a bad idea, however that assumes that a person's role is constant throughout the years captured by the graph, which may not hold true. Or rather, the labels would capture what roles they have been in their entire history, but what specific role they played within a particular movie is likely something you want as a property of the relationship itself, like a role property. Which might even be a list, if a person might have multiple roles for the same movie, similar to actors playing a part (where there is a roles list property on :ACTED_IN relationships).

Ruby on Rails has many categories association scope issue

I am making an app in which there are three models individual, company and event.
company,event and individual lies in a single category.
here the company can create an event where they can choose multiple interests from categories and search for individuals that lies in that categories also when individual signs up they can choose multiple interests from categories table to find the companies of the interests and this same applies for company.
the solution I want is to prepare the best logic for this
my assumption is to create an Interest model where company , event and individuals has_many interests and interest belongs_to category
but this assumption seems to be confusing
Please suggest some logics

Struggling to design an appropriate core data layout based on my class diagram due to its different take on relationships and inheritence

I am new to swift and I am currently having trouble figuring out how best to go about designing my core data entity map.
My class diagram defines:
1) a student object
2) subject objects
3) event objects (which is a parent class to 3 types of events: Study session, assignment and test, each with various unique attributes)
The idea is that the student is linked to the subjects that they take, and when they create an event (be it a test, or a study session), the event needs to be linked to its relevant subject.
I've read quite a bit about inheritance in core data but a lot of them contradict each other so I am hoping someone can give me an answer based on my specific (although not complex) needs.
Thanks in advance.
If you break it in parts you have:
Student to Subject: What is a many-to-many relationship as a student can subscribe to many subjects and a subject can be subscribe for many students
Subject to Event:
This can be in two ways:
Many-to-many:
where a Subject can have many events related to it and an event can be related to many subjects
Many-to-one:
Where a Subject can have many events to it but each event belong to just one class
In this scenario Students don't get linked to Events directly as it is depending in with subjects the student is taking.
You can set to-many in the xcode as show bellow:
To set many-to-many you have to set this option in both tables.
I am not sure if this was what you are looking for, but I hope it helps you.

How do I model teams, games, and home/away team relationships within Core Data?

I am trying to use Core Data to represent a sports league's schedule. Within my model I have an entity called Team and an entity called Game. Each team will have many games. Each game will have two teams, one that is identified as the home team and the other that is identified as the away team.
In my current approach I have defined "homeTeam" and "awayTeam" relationships within the Game entity. Each of those relationships are to-one and have their destinations set to the Team entity. I have also defined a to-many "games" relationship within the Team entity that has its destination set to the Game entity.
The problem with this approach is that I can't set the inverse relationships in any appropriate way. It would require the Team/games relationship to be the inverse of both the Game/homeTeam and the Game/awayTeam relationships, and that isn't allowed (as far as I can tell). I could of course define these as unidirectional relationships but I start getting Xcode warnings and I'm not sure that's a good thing to do here.
I've also considered removing the awayTeam and the homeTeam relationships from the Game entity and replacing it with a teams relationship. That relationship would be many-to-many with Team, with a min and max value of 2. However, the approach doesn't allow me to distinguish between the home team and the away team, which I will need to do in my app.
I'd appreciate any recommendations for the best way to represent these kind of relationships within CoreData. I could no doubt implement this myself using my own DB layer, but I'd rather rely on CoreData than come up with a home-grown solution here.
Here is how I would do it:
Game has two one-to-one relationships, homeTeam and guestTeam.
Team has two one-to-many-relationships, homeGames and outGames. The inverse of homeGames is homeTeam, and the inverse of outGames is guestTeam.
Makes sense?

Rails design pattern: groups and individuals in one distribution list class

I have a class User, which has many Events and belongs to many Groups. I want to allow user to create Event and restrict who he wants the invite by Group, by user id or by both.
I am thinking creating a table Invitee to store all users' id and events id. For each Event, when user A chooses to invite group Z and users B and C, I will query group Z to find all user id of the members and add them to Invitee table, together with B and C's user id.
I think it is might not be the best way to do it. I wonder if there is a better way to do it.
Thank you.
Look in to polymorphic associations: basically you want invitations that can be either entity type.

Resources