creating individuals with same name in protege - ontology

I am using Protege 5.2 to create domain specific ontology and i need to create two individuals with the same name under the same class, is there away to do that in protege.

You may do this if you develop your ontology following the OWL2 specification (this is not allowed with OWL1) by first creating a new individual (for instance in the individuals tab) and modifying a posteriori its iri (ctrl+u on most platforms).
Note that the new entity will be completely independent from the original class, including for reasoning. See more details on the W3c page about "punning"1

Related

How to import a single class from an ontology(Turtle file which has many classes) and create a graph?

While working on a project, I was struck at a point where I am not able to find a standardized ontology for "Product" in schema.org and also don't want to create a custom ontology.
I understood that schema.org has the ontologies which are standardized and are being used by many organizations. and also understood that some organizations create their own ontologies.
Now, for my requirement. I want a standard Ontology for "Product(s)".
I couldn't download the RDF/XML file or the Turtle file from Schema.org which just has "Product" ontology in it. I could only download all the Ontologies which are in Schema.org in a single file. This single file has many classes and subclasses in it and one of them is "Product".
I know how to import an OWL file and create a graph using Neo4j n10s plugin but I am not sure how to only extract the "Product" class from that whole file and create a graph for just that Class.
So, my questions are:
Can we import a single class from an OWL file which has many classes and create a graph for just that single class?
If so, how to import a single class from an ontology(which has many classes) and create a graph in Neo4J?
If importing is possible how do I do it with a locally downloaded OWL file vs Referencing a link?
Thanks in Advance.
Regards,
Jashwanth

Dynamic Spring Data Classes for Neo4J based on an Ontology

I have to create a web service that needs to interact with a Neo4J database using the Spring framework with Spring-Data-Neo4J. This requires a static data domain model, e.g. defined labels, relations, properties.
The Problem is, that my data is based on an Ontology (via the neosemantics plugin) which could be modified in the future. It would be great if the application could automatically adopt to it. This way, the data model could be extended by editing the ontology only and no additional programming knowledge would be necessary.
Does this mean I have to generate the Spring data classes dynamically (based on the Ontology) or is there a better way to achieve this with Spring-Data-Neo4J (or should I use a different framework)?
Sure, you could come up with a way to generate a set of classes from an ontology. But that is probably going to present more problems than it solves.
An automatically-generated set of classes may not correspond to an appropriate data model for your use cases. The determination of the appropriate data model still requires a human.
Also, the new classes may be incompatible with the existing client code. And you may have to migrate the existing DB over to the new data model. Fixing all that requires humans as well.
I ended up using the Java neo4j driver instead of Spring-Data-Neo4jand a generic node class implementation only having the fields id, list of labels and a map of properties. The set labels and properties can be checked against the ontology prior to creating the nodes in the database. This way I can enforce a specific set of node labels and properties by only modifying the ontology and without having to generate the specific Spring-Data-Neo4j data classes.

Standard Entities in Watson Knowledge Studio Custom Model

I have built a custom model for identifying customer specific entities in Watson Knowledge Studio. Can i leverage and reuse standard entities (e.g. Email) which are part of the standard model in the custom model without having to redefine them from scratch?
I had the same question and found the info below - more details are at: https://watson-tricks.blogspot.com/
Post titled - "Combining the annotation capabilities of both Watson Knowledge Studio and Watson Discovery Service"
"It is not feasible for users to build a complete WKS model that incorporates all of the normal language dictionaries as well as the specialized domain terminology. However, there is a trick which can be used to get WDS to use both the domain specific annotator from WKS and the generic language annotator from WDS.
Unfurtunately this trick is not possible with the normal WDS UI, but it requires the use of the REST API"
I couldn't find enrichment for NLU. However i simply called the Analyze request two times, once with a custom model for Entities and second time without it. Got two JSON's and will combine the two to get a final list of entities. Not cost effective though as the number of requests will increase

Set parent entity defined in bundled Core Data model

I'm working on a static library that will help sync Core Data iOS apps with a remote SQL database. My library relies on a few sync-related attributes that each Core Data entity must have, so I've created a parent entity, SyncObject, that all other entities inherit from. SyncObject is defined in the static library's data model and is included in the resource bundle (how's my terminology?)
When I create a new app that uses this library, I merge the the app's data model with the library's data model and programmatically set all of the app's entities as sub-entities of SyncObject. Remarkably, this all works, but it feels clunky: when auto-generating entity class files, I have to manually change the base class to SyncObject (which is itself a subclass of NSManagedObject) in the .h file, and I can't define relationships between entities in the app's data model and entities in the bundled data model because the Xcode data model editor doesn't know about the entities defined in the external bundle.
Is it possible to make the editor aware of bundled data models? If so, how?
I would strongly recommend against this design. If all entities inherit from a single entity then your entire Core Data SQLite data structure will existing a single table. The performance cost for this is quite simply huge.
It is not possible to make the data modeler aware of the bundled data model.
Update
There is a difference between subclasses and sub-entities. There is nothing wrong with Subclassing. Creating sub-entities, however, is quite different and is designed to solve a different problem. Sub-entities are meant to intentionally combine so entities so that they share a common root and share a common set of properties or relationships. The cost of that is that they also share a common table. Which in the situation that they are intended for is not a significant cost.
The thread you referenced confused subclasses and sub-entities. They are not the same and they do not even need to align.
Trying to have an entire data model be sub-entities of a single parent entity is not the intended use of that feature of Core Data. It will cause horrific performance penalties and eventually stop your application from working. You would be better off working from a different design. For example, you could force them to subclass from your class which then subclasses NSManagedObject and do what you need to do in that subclass. You could further require an attribute to exist in each entity so that you can complete your goal.
mogenerator works in that vein (although it does not require an attribute to exist in the entities). There are also syncing frameworks that work off a similar design. They require that each entity have a unique identifier key, etc.
You could go even further and not necessarily require an attribute but instead require that the subclasses define a unique identifier so that you framework can uniquely identify each instance of an entity. You could then work with that uniqueID without requiring its definition be specific (a string, a number, etc.).

Creating a Class Diagram to model a MVC application

I'm creating an inventory system with Ruby on Rails as the application server and having java clients as the frontend.
Part of the project mandates that we create an integrated class diagram (a class diagram that includes all classes and shows the relationships). The way the class has been designed and what we've been taught before was to use the Boundary-Entity-Controller (BCE) pattern to create appropriate classes, however, since we're using Rails which uses an MVC architecture, they directly conflict since there is not a 1:1 correlation between the two patterns, especially considering that the 'views' in our case is just XML, so there will be no class diagram for the views and a Boundary class shares the input of the controller and the output of a view.
So far, our class diagram just features the Rails related classes (since the client classes are mostly just UI). Here is the result of what we've done so far (ignore the fact that we have a million getters and setters -- it's a requirement for the project that we won't actually be implementing in that way; we'll use attr_accessor):
So, are we on the right track? Anything to add/edit/move? How exactly do we model correctly the built in ActiveRecord validator methods that we'll be using (such as validates_numericality_of :price)?
Any help is greatly appreciated! Thanks.
It seems like you are given several constraints. If I understand it correctly, you used BCE in the analysis and MVC for architecture. In RUP there are two models for these purposes - analysis model and design model - both expressed through class diagrams. So if you want to show that you used the BCE approach as well as the MVC architecture in one monstrous diagram, you can draw Boundaries, Controls and Entities from analysis and your solution classes based on RoR for the design and connect them using dependencies with <<trace>> stereotype.
I am not entirely sure how are the validate methods implemented in RoR, my guess is, when you call validates... method in a model class definition, the particular model class is enhanced through metaprogramming with new private method, which will serve as a callback for the validation phase. I am really not sure about this, but if it is true and there is metaprogramming involved, you have a problem. AFAIK, you can either draw diagram which will show the classes after adding the methods (something like an object diagram on the class level...) or you could model the metaprogram through package merge, which is not easy as well.
You have correctly analyzed the conflict between BCE and MVC. So let's try to map your classes:
Employee, Store, Product, Location are clearly «entity»
EmployeeController, StoreController, ProductController, LocationController are clearly «control» that corresponds to the simpla management of the individual entities.
ActiveRecord is not really an entity. This shows that you are no longer in an analysis model, but already in a design model that is more refined. You could then nevertheless use «entity» since this class contributes only to their implementation.
Manager and Receiver are somewhat to ambiguous for me to categorize properly. If however, there are supposed to represent a special role of an Employee, it would be better to use composition over inheritance, because an Employee may start as Employee and then one day be receiver, and later be manager. The generalisation/specialization relationship does not allow this flexibility: if an employee is created, it will be either Manager or Receiver all its life.
What is not so clear, is if your XxxController really correspond to use-cases, and really do the coordination between the contributing classes:
Use-cases typically are described by verbs, such as Maintain employee records instead of EmployeeController.
Use-cases may need to access several entities. For example one part of maintaining employee records, is certainly to assign an employee to a store. Since the controller will be responsible to coordinate between all the objects, it should also access to store, since it needs to make sure that the store assigned to an employee really exist and is in a status that allow assignement (e.g. not in statuse "StoreShutDownDefinitively"). ANd this is absolutely not clear in your current diagram.
Last but not least, a «boundary» is in principle expected, for every link between an actor (user or remote system) and a use case. Makeing the XML is not sufficient: you need either to send the XML to another system, or display the XML on the screen, with some scrolling if needed. ANd maybe you'll have to react to requests or give the user the opportunity to query for another record:
In an analysis model you would have as many «boundary» classes as linked actors.
But in a design model, you could decide to regroup several boundaries together into one class that cover them all. But you need at least one boundary class.
I don't know RoR, but if I understand well the diagram in that article, your boundary would correspond to the view and the routing. In a classical MVC, you'd also have the controller in the boundary. But looking at the details of the article, I have the impression that RoR ActionController are in fact closer to use-cases (i.e. «control») than to an MVC controller.

Resources