Predicates equivalent - properties

I am looking for an approach to find two predicates (properties) of semantic web are equivalents or not? is that possible using description logic or another methods?
Thanks a lot

If I understand the question correctly, you can use OWLAPI method getEquivalentObjectProperties() of class OWLReasoner.

Related

why prefer to use containment to inheritance?

I remembered that I read once in a book that teaches
try to use composition as far as you could. I forgot the reasons now, anyone could give the hint?
I had been confused same as you until I found this explanation:
Inheritance is Bad: Code Reuse Great example where author explain inheritance based on example typically used to show why inheritance is "great".
Favor 'object composition' over 'class inheritance'. (Gang of Four 1995:20)
Read the book

Explain the difference between CreateCriteria(typeof(Cat)) and CreateCriteria<Cat>()

I've seen both formats in different examples, tutorials, blogs, etc, but for the life of me, I cannot find an explanation for the difference. What is the difference between
ICriteria crit = session.CreateCriteria(typeof(Cat));
and
ICriteria crit = session.CreateCriteria<Cat>();
When do I use one and when do I use the other?
An example of a tutorial using session.CreateCriteria(typeof(Cat)) can be found at http://nhibernate.info/doc/nh/en/index.html#quickstart
An example of a tutorial using session.CreateCriteria() can be found at http://ayende.com/blog/4023/nhibernate-queries-examples (table Blog instead of Cat)
Thanks so much!!
There is no difference. You can/should use the generic one if possible, and non-generic if you have access only to a Type instance (some reflection).
The non-generic is part of NHibernate from the moment when it was imported from Java Hibernate.
The generic was added in the Build 2.1.0.Alpha1 release.
But because the result is non-generic ICriteria (in comparison with result of the QueryOver<T>()) it is just a syntactic sugar.

Should I be using classes for something simple like solving math problems?

This is a question about using an object-oriented language. I've been using C++ to solve Project Euler for a while, and I recently read in an article that a lot of people treat C++ like a procedural language, since you can get away without creating classes. I've been doing exactly that.
My question is whether it's "bad" to just be writing functions in an object-oriented languageint mult_order(int base, int mod) for multiplicative order, gcd(int a, int b) for gcd, but without putting them in a class). I've been "reinventing the wheel" a lot for the purpose of learning--should I put them in a library, or create a Math class or something along those lines?
From what I've been taught (and what I've experienced), the underlying idea behind OOP is a simple one:
Use it when it makes your life easier.
It could easily be the case that, for your purpose, using a class wouldn't make things easier - you don't have a reason to repeatedly access a single object that performs these mathematical operations - or creating a class would create unnecessary overhead.
For your example, I think you'll be fine without objects, but do consider that somewhere in the future, it may be necessary to create an object that can handle those operations.
It seems you need to be using a namespace instead of a class.
There's nothing wrong with having functions that don't belong to a class, but you should still group them together.
Use a class when you need properties for an object, or inheritance, or state, not just so you can group functions together.
The main benefit using classes is going to give you is reuse through inheritance. So if you find you have situations where you have some common code, and then other sections of code that are variations on that, then making classes would help you. If not, then you are probably OK the way you are. Not every problem has to be solved with object oriented programming.

One-way inheritance with HNibernate

I frankly haven't got a clue what to search for reagarding my question, so here goes.
I'm trying out some different approaches for a new project I'm starting on.
I have a PostgreSQL DBMS. I have a single DB with multiple schemas. The idea is that there is a "root" schema, which works as a foundation for the other schemas.
What I'm trying to achieve is a sort of "one-way" inheritance. I'd like my queries in the root-tables to not look at the subclassed schemas, but I haven't found a way to do that.
When querying the subclasses, I'd like to join with the base class, but when querying the base class, I don't want to query the subclasses.
I understand the difference between the different inheritance approaches, but I'm just not sure if what I'm trying to do is possible.
My current setup actually works with subclasses in different schemas, but when querying the base class, NHibernate goes to query each of the subclasses to see if the base class is any of those types.
Maybe the behavior is appropriate in some situations, but in others, I'd just like to query the base class "alone".
As another requirement, the base class cannot know about the subclasses (they're like plugins/extensions).
Hope the above made any sense - it was a bit difficult to express.
Thanks in advance...
<class ... polymorphism="explicit">
See http://www.nhforge.org/doc/nh/en/index.html#mapping-declaration-class
I figured it out. My problem was in my SubclassMap<>. Apparently NHibernate don't support explicit polymorphism with joined-subclass. I am now joining each subclass using ClassMap<> and calling Join(...) instead. In this scenario, explicit polymorphism works.

Is there a name meaning "not a singleton"?

Is there a name meaning "not a singleton"?
Castle Windsor uses the term "transient" to describe all non-Singleton objects.
I personally prefer the term "non-Singleton" though.
Yes, there is a Multiton pattern, but it means something very specific. It's not simply everything that's not a Singleton.
Prototype.
It is used as a scope in Spring framework to identify dependency which will always be new instance when injected.
When someone asks me if a class is a Singleton (and it isn't), I just say no, it's a regular class.
Multi-Instance ?
http://elegantcode.com/2008/04/17/the-opposite-of-a-singleton/
Actually, there is a variant on the Singleton called Multiton or Multiplton or something like that. Rather than having one instance, you have n instances where n is a specific value. I'm not sure if the Gang of Four describe this application in their book, but I learned about it in my Software Engineering 361 class.
But if you have an unconstrained number of instances, I don't think there is a name for it.
Simply, a 'Single Instance of a Class.'
This is an old post, but if someone still comes across then a better word is "multiplex" over "transient". IMHO
Definition:
noun:
a system or signal involving simultaneous transmission of several messages along a single channel of communication.
There is a related thread about this over at English Language & Usage. Looking through the various suggestions posted there, I think the best one is
replicant
I've adopted this term in the naming of methods and the wording of comments in a little PHP Reflection factory I've built.
How about the word "Instanced"