I am very new to creating ontologies, and I'm trying to make one for a club and society section of a website only using a few classes.
This is my structure so far (classes then indented for sub classes).
Person
Member
President
Treasurer
Club/Society
TypeOfClub
Community
CourseRelated
FaithAndCulture
HobbiesAndInterests
MediaArtsAndMusic
PoliticalAndActivism
Venue
Booking
Location
I'm not 100% sure if what i'm doing is right. I just got rid of a lot of my sub classes realising that they were data type properties (number of members, joining fee) so now I have very few sub classes and can't think of what to add in their place.
I have venue as separate from location because I was trying to add in an rdf file that dealt with location in protoge (just to see how it would work).
Is there anything I should definitely add/get rid of with my class structure?
I hope this documentation http://protege.stanford.edu/publications/ontology_development/ontology101-noy-mcguinness.html will help you to get a basic idea about Ontologies
Related
I wonder how can we make an ontology using Description logic syntax (A-box, T-box) for a staff of a university? What classes, objects, relations, parents, siblings, constraints and interrelationships among them we can make?
I made the below class diagram but not sure if anything else could be added to it.
UML class diagrams can be translated to TBoxes and object diagrams to ABoxes. See for instance https://henrietteharmse.files.wordpress.com/2017/11/uml-class-diagram-to-owl-and-sroiq-reference.pdf.
I have a bunch of questions regarding Java 8 and SDN4. I created a model in Neo4j v3.0, played a bit with Cypher queries, and now moved to creating a Spring Boot application. As i started coding classes in Java, I've begun to rethink some of my model as well. Here's some questions in my mind (and I haven't found an example explaining this):
Do you need to use Interfaces in Java, with SDN?For eg. I'd code a Product interface and then have my products implement it, but is that how it's done when working with labels?
This is somewhat tied to my question on inheritance - I'd usually have a ProductFamily that my Product would inherit from. At the database level its modeled as (:Product)-[PartOf]->(:ProductFamily), but in the code these would not be super/sub class.
Any examples of using Generics in a graph context?
Is there a way to define constraints on what relationships a node can have and their direction in Java?
I understand there is probably not one right answer, but there's precious little on the web, so hope to get enlightened here!
If you had a Product interface annotated with #NodeEntity, then the you'll have the Product label in addition to the label on your implementing class, which I assume is what you want. If your interface isn't annotated, then your implementing classes will not inherit a label from it.
Not sure what you mean- if you say you have a ProductFamily that Product inherits from, but in the code it would not be a super/sub class?
Based on your graph model, if you want (:Product)-[PartOf]->(:ProductFamily) then you will have a Product class that maintains a reference to a ProductFamily class, and that reference annotated with #Relationship. If the Product class inherits from ProductFamily then persisting the Product will result in two labels- Product and ProductFamily because a Product IS-A ProductFamily.
How do you see yourself using generics- the answer really depends on that. Some cases are supported, some are not (an example of something not supported right now is equivalent of template.createRelationBetween in SDN4)
Yes, via the #Relationship annotation which accepts a type and direction. Note that this annotation only constrains your domain model, but you could very well flout this by creating relationships in another direction via a custom query.
I'm trying to implement the OpenEHR reference model in Rails (ActiveRecord), but I'm finding some problems, since it works with a lot of different of different classess,
Here is the diagram of a Composition:
As you can see, a lot of classes "inherit" a couple of attributes from Locatable or Pathable* (the whole reference is huge, and almost every class inherit from it).
Also, it establish data_types as other classes, for example in the same composition class, language is class CODE_PHRASE, that have two attributes (link).
Therefore I encounter two problems 1) how can I inherit attributes from abstract classes, and 2) how is that I can "include" the needed "classes".
For the first problem I thought in using Polymorphic Associations.
For the second one, I thought using STI, but I'm quickly finding a lot of almost similar models (they are exactly the same actually): CompositionLanguage, CompositionTerritory, EntrySetting, EntryEncoding that I only use in the type attribute to "link back", for example: The composition class, can have up to three attributes with CODE_PHRASE, since all three references a different attribute (language, territory and category), I thought that I needed to know for the associations (there's no point in knowing that Composition has 3 code_phrases, but I didn't know which one is the corresponding attribute). On the other hand, the Entry class, have the setting and encoding attribute (link).
I realize that there could be different approaches, but I would really like to know if that maybe Rails (or ActiveRecord), wasn't made for this. Or, maybe I'm missing conceptual info.
The openEHR RM specification has deeply nested inheritance and composite patterns with tree hierarchy.
I could not implement this nested inheritance by ActiveRecord. The following implementation is an example to simulate openEHR RM.
I would be very happy if this example could help you.
https://github.com/skoba/openehr_rm_rails
Have you looked at this project ..
https://github.com/skoba/openehr-rails
I think Shinji uses Active Record.
Personally, given the complex structure of the openEHR RM, if I was starting out I might look to use something like MongoDB with an ORM.
I have pointed the openehr technical community to your question via the openehr technical list to see if others can help.
Ian
Is there a way to add more belongs-to relationships to an imported GORM domain class? Specifically, I'm attempting to use table-per-class to extend a shared subclass, but if I do this in two (or more) locations, and the locations do not have knowledge of each-other then things like:
set.addToParents(parentSet)
Start leading to:
org.hibernate.WrongClassException: Object [id=3482] was not of the specified subclass [com.acumenllc.domaincore.DbSet] : Discriminator: com.acumenllc.tickets.domain.TicketSet
happening everywhere.
A little more background, I'm working on a closure table to keep track of related objects. The base class recognizes the parent-child bi-directional relationship, as well as the ancestor-descendant extension of it. Different applications then extend this class with belongsTo relationships on objects to be represented as nodes in the resultant graph. We specifically want to be able to more-or-less ignore some of these other classes in other applications that happen to share the same database.
Ideally, it would be possible to import our base domain class into a new application and, rather than extending into a subclass, re-define the set of relationships that the base class recognizes in the scope of the application.
The only practical way I can see of doing this is with .hbm.xml files. The GORM approach of including hasMany/belongsTo in the code and JPA's approach using annotations are both fairly inflexible to support this sort of mapping. But if you separate the configuration from the code, you can define the relationships for different applications however you like. Creating a hibernate.cfg.xml file and the hbm.xml files is described here in the docs.
I have been reading a lot about the importance of keeping layers separately and the concepts are mind blowing :) . However,I looked into many places to find a practical example on how to separate these three types of models and had no luck. How do I connect them together in a practical situation? Here are few questions I have
My understanding is that persistence models contain the POCOs that we use to create entities , domain models contain the business logic and view models are used to expose relevant data. Am I correct?
If I am correct , how do I actually connect these different layers in a single solution. I mean at the end of the day , they are classes and how do I connect domain class(model) with a relevant persistence (model) and the view model?
Can someone please point me to a great tutorial that teaches how to build n-tire asp.net applications?
If not, and if possible can someone tell me how to build and connect three types of models for the following scenario.
A Customer has a Name , DOB , Address and a collection of Orders
An Order has a Customer, Date , Price and a Description
How do I create separate persistence, domain and view models(eg: A view model to display all information about customer except DOB and all orders related to the customer )
More importantly how do I connect them?
Thanks heaps!
Cheers!
you create viewmodels to match the view, not every property from the model (Entity) you might want to show in the Create/Edit view, or you want to show it but combined or in a different way, that's why you need viewmodels, usually you would have a property in the viewmodel for each editor/input in the view
for example in the Entity you can have one DateTime property but in the ViewModel 2 properties one for Date and one for Time,
or in the Entity you will have property of type Country but in the ViewModel of type int (the value of the id)
and when you have this separation you need to map Entities to ViewModels and the other way around
for demo app you can look here: http://prodinner.codeplex.com/