RDFS: if A hasManager B, can it be inferred that B manages A? - rdfs

I'm a bit confused as to what can be inferred from RDFS triples.
If there's a shop with a staff Lily and manager Dan,
and shop:Lily shop:hasManager shop:Dan
can it be inferred that shop:Dan shop:manages shop:Lily?
or are they technically speaking different relationships and hence cannot be inferred?

The OWL property inverseOf allows you to define an inverse relation between properties.
So it could be inferred (as #JeenBroekstra notes, only by an OWL reasoner) if you state something like:
shop:hasManager owl:inverseOf shop:manages .

Related

In OWL, is it possible to assert that a class is not "empty"?

Given the different types of axioms available in OWL, is it possible to assert that a class is not "empty"? Or in other words, can we assert that there exists at least one individual that is part of the specified class?
So, basically I am looking for an equivalence of:
ObjectAssertNotEmpty(a:SomeClass)
In an RDF serialization, all it takes is to identify such an individual:
[] a a:SomeClass .
I presume the OWL syntax should be able to specify it this way:
ClassAssertion( a:SomeClass a:SomeIndividual )
It doesn't matter that you call the individual a:SomeIndividual here, it could very well be owl:sameAs any other individual. Once you state that something is in the class, it follows that the class is not empty.
That is exactly what the model theoretic underpinning of Description Logics aim to do is to assume that all concepts (or OWL classes) are not empty. When a reasoner is run over an ontology, it will give an error if a class is found to be empty. Such a class is deemed to be unsatisfiable. That is the basis of satisfiability checking (and consistency checking, since satisfiability checking can be translated to consistency checking).
See An introduction to Description Logics text for details.
Here is a simple example ontology to illustrate this:
Class: A
Class: NotA
EquivalentTo: not (A)
Class: B
EquivalentTo: A and NotA
Individual: b
Types: B
Note that class B will be equivalent to owl:Nothing which is the empty set. Now setting individual b to be an instance of B will lead to an inconsistency with explanation as shown below.
The answer as given by #IS4 will only work if SomeClass is found to be satisfiable (that is not empty), otherwise the reasoner will give an inconsistency.

what is the differenc between these two "statments" in desciption logic

I don't know if you call this statement or not, but I have this question
what is the difference between these two statments :
A ⊑ B ⊓ C
and
A ASSERTA_SYMBOL = B ⊓ C
sorry I don't know how to write the ASSERTA_SYMBOL, but it is in this image
a real example is this:
Both expressions describe or define a concept (or class or set).
The difference is subclass vs equivalent class.
An elephant is one kind of grey, large animals. There might be other kinds.
A happy father is a man who has at least one daughter and any man with at least one daughter is a happy father. There are no others.
⊑ represents a subconcept relationship, ≐ means agreement (sometimes called the same as constructor).

Describe a film (entity and attribute) using the first order logic

Good morning,
I want to understand how can I describe something using the first order logic.
For example I want to describe what is a film (an entity) and what is an attribute (for example actor: Clooney) for the film. How can I describe that using the first order logic?
******* UPDATE ********
What I need to explain in first logic order is:
ENTITY: an element, an abstraction or an object that can be described with a set of properties or attributes. So I think that I must says that the entity has got a set of attributes with their respective values. An Entity describes an element, an abstraction or an object.
ATTRIBUTE: an attribute has always got a value and it always associated to an entity. It describes a specific feature/property of the entity.
DOCUMENT: a pure text description (pure text it not contains any html tags). Every document describes only ONE entity through its attribute.
To state that an object has a certain property you would use a single place predicate. For example, to state that x is a film you could write Film(x). If you want to attribute some value to an object you can use two (or more) place predicate. Using your example you could say that Clooney starred in a film as Starred(clooney, x).
There are certain conventions that people use. For example, predicates start with capital letters (Actor, Film, FatherOf) and constants start with a lower case letter (x, clooney, batman). Constants denote objects and predicates say something about the objects. In case of predicates with more than one argument the first argument is usually the subject about which you are making the statement. That way you can naturally read the logical formula as a sentence in normal language. For example, FatherOf(x, y) would read as "x is the father of y".
Answer for the update:
I am not sure whether you can do that in first order logic. You could describe an Entity as something that has certain properties by formula such as
\forall x (Entity(x) ==> Object(x) | Element(x) | Abstraction(x))
This is a bit more difficult for the Attribute. In first order logic an attribute ascribes some quality to an object or relates it to another object. You could probably use a three place predicate as in:
\forall attribute (\exists object (\exists value (Has(object, attribute, value))))
As to the document, that would be just a conjunction of such statements. For example, the description of George Clooney could be the following:
Entity(clooney) & Has(clooney, starred, gravity) & Has(clooney, bornIn, lexington) & ...
The typical way to do this is to explain that a specific object exists and this object has certain attributes. For example:
(∃x)(property1(x) & property2(x) & ~property3(x))
aka: There exists a thing that satisfies properties 1 and 2 but does not satisfy property 3.
Your current question formulation makes it unclear as to what you mean by attributes and documents. Perhaps towards your idea of attributes: it's possible to describe as the domain of property1 all the entities that satisfy it; so, for example, the domain of blue is all blue objects.
First-order logic has nothing to do with HTML -- are you trying to use HTML to represent an entity in first-order logic somehow? It remains incredibly unclear what your question is.

Chomsky Hierarchy Type 2: Not terminal symbols on left hand site

is it allowed to make two non terminal symbols on the left handed side of a grammatic in type 2 grammatic?
I should define a Type 2 grammatic for the Language L2. It was easy if it is allowed to do a rule like
CB->BC but I'm not sure if this would violate any rules. In Type 1 it'd be easy.
Thank you!
No. According to the Chomsky Hierarchy, a Type-2 Language is characterized by rules in the form $A \rightarrow a$ where $A$ is a variable and $a$ is $(V U T)^{\ast}$,

Unrestricted variable name declaration in Mercury

I would like to declare a data type in Mercury that can have a variable number of values and names. For instance :
type goal ---> pick; give; come.
has three variables/values.
I want something like:
type myplayer ---> de value declaration here.
That's the number of variables are not restricted or fixed.
So I can use myplayer to declare values/variables like v1, v2, v3 and v4. The second time I can use it to declare something like: a, b, c, d, e, z, aa, ab and az.
The number of the values are not restricted and the names are also not fixed.
I am new in Mercury.
As others have said, this is simply impossible in Mercury - which is deliberate.
What you might want though, if you want a type that expresses: v1 v2 v3... etc is:
:- type my_type
----> v(int).
:- func name(my_type) = string.
name(v(Num)) = formst("v%d", [i(Num)]).
The type expresses v of all integers, and the function name can be used to 'pretty-print' values of this type.
What you directly ask for, simply cannot be done. Given
:- type question
---> truth(string, bool)
; blank(string, string)
; multiple(string, string, list(string)).
additional kinds of questions can only be added by extending this type where it is defined, and recompiling the module - and making a lot of other changes, too, as previously deterministic code like
answer(truth(_, yes)) = "true".
answer(truth(_, no)) = "false".
answer(blank(_, A)) = A.
answer(multiple(_, A, _)) = A.
would fail when given your new question type. Being told at compile-time where you've failed to update your program to reflect the addition of a "pick-all-the-right-answers" type of question is a good part of the reason you have a question type at all, instead of say lists of strings [["Are foxes pretty?", "true"], ["Green foxes are ____", "adorable!", "fake", "evidence of animal cruelty"]] for your question bank.
What you ask for cannot be done. However, what you actually want to do -- the end to which you thought 'variable numbers of types' would be an helpful means -- can surely be accomplished in some other way. I can't tell what way that is, as I can't tell why you wanted to do this from your question. Maybe you'd benefit from reading over discriminated unions or typeclasses in the language reference.
As far as I understand this question. You want some Prolog-like behavior. I.e without typed predicates. In statically typed system you always can achieve such behavior by handling that by yourself. A lot of time ago I saw such example in Turbo Prolog (they implemented ISO prolog in terms of Turbo/Visual Prolog).
Consider something like (I'm not sure it is correct):
:- type any_type ---> atom_value(string)
; number_value(int)
; struct_value(any_type, list(any_type)).
guess(atom_value("v1")).
guess(atom_value("a")).
guess(atom_value("aa")).
guess(number_value(42)).
guess(struct_value(atom_value("pair"), [number_value(3), number_value(4)])).

Resources