Mixing properties with categories

From semantic-mediawiki.org

Hey,

i will put an example to make this question as brief as possible:

I create a category called "Book".

I create a property called "Book"


I create a template called "Lectures" which has one property called "Bookings" which uses "Book" property.

I create a form using this template, and maintain this property with the same name.

I go to "Lectures" form, and create an article with it, which includes a Book (as it was it´s property).


So, this property will appear in "properties:Book", but not in "categories:book".

How can i make that when someone fills a form with a property name which is also a category(apart from property", it appears also as category?


I am asking this because i am making an structure were i want to link 2 categories.

For example if i have a category "teacher" and "school", and i want to know where the teacher teaches, i can only make a form using "properties", so that if i make a property named "school" in "teacher" form, this will not appear in "category:school", but in "property:school", so they are not really connected between them.

To sum up: I would need something that says "if they have the same name, "property:x"="category:x".

Or something which makes a property able to point to an specific category.

10:15, 6 April 2015

Please have a look at Help:Classification and Help:Adding_subobjects#Using_categories (it should give you some insights about the category vs property issue).

> "property:x"="category:x"

property:x is about the thing x, while category:x is about a class x.

In your "world" ("world" in a sense of the wiki that hosts your content and ultimately your facts model) you can make it appear to be represent the same entity of knowledge but for SMW (in core) a category and a property are distinguished hence not mixed with each other.

> How can i make that when someone fills a form with a property name which is also a category(apart from property", it appears also as category?

This should be possible to achieve in your template with some if/else statements. Please remember, input is done by the form but the actually annotation is added by the template (after the input processing has finished).

11:24, 6 April 2015

Ok, i read those and have been trying to achieve it through subobjects, but something it going wrong. If it is not much demanding, could you please tell me an example?

For example having a category "Teacher" with has as a property in its template called "Subjects", which refers to the subjects he/she teaches, and having a Category called "Subject" which i want to be automatically filled when someone fills the Teacher form.

01:43, 7 April 2015

> Ok, i read those and have been trying to achieve it through subobjects,

The links were only listed to illuminate the issue about category vs. property and how SMW interprets both entity description types.

> could you please tell me an example?

If you look at the bottom of Template:Event calendar item you can see how a switch function is used to add additional annotations to a subject that depends on the input of the Form:Event calendar item. It should be possible for you to make similar adjustments to achieve your "hidden" property = category assignment (data input post-processing).

In case you want to make some form field to be pre-selected/pre-filled based on some input dependency from another field, you better ask for assistance on SF talk page (this has less to do with SMW in relation on how data are represented or stored).

02:20, 7 April 2015

So there is not actually a direct way of representing "graph" type data, but just individuals with properties, right? Well, we can have something like "graphs" with "subclassOf", but not having pointers from a category to other.


So if i do have 3 categories, department (which includes subjects), teacher (which teaches subjects) and subjects, if i added subjects to department and teacher, i would still not see nothing in "subjects" category.


I understand that properties and categories should be differenced, but i am pretty much surprised there is no way of making a form or template which instead of properties, can use categories as information source.

Something that gives me hope, it that semantic forms has 2 options for it´s properties which are "category" and "categories", so perhaps someone has been trying to solve this issue.

Unluckily the only thing which this does to your form is writting a box with "name" which you can not even fill, so perhaps it was forgotten.


What is that SF talk?


P.D: I would be more direct with this question. "How can we use categories, instead of properties in forms or templates?".

17:58, 7 April 2015

> So there is not actually a direct way of representing "graph" type data, but just individuals with properties, right? Well, we can have something like "graphs" with "subclassOf", but not having pointers from a category to other.

We need to clarify the use of the term "graph" in relation to SMW, OWL and machine-readable descriptions such as RDF.

When you create an article (a subject, the source of a collection of facts about that subject) together with a property-value or class (a category) annotation you express a graph that says "my subject contains an attribute (the property) with an value of ..." or "the subject belongs to a class of ... (a category)". So when editing/creating/annotating an article you declare a "graph" that can be encoded into an equivalent representation such as RDF (for more see RDF export.

> So if i do have 3 categories, department (which includes subjects), teacher (which teaches subjects) and subjects, if i added subjects to department and teacher, i would still not see nothing in "subjects" category.

I'm not clear about what you mean by "still not see nothing". If you query for the relation you should be able to see those which belong to either category. A declaration such as "subclassOf" is automatically resolved (see also category hierarchy, $smwgUseCategoryHierarchy). Relationships will not appear automatically on an article (this is where you have to employ queries to make them visible, see also Inverse properties and Inferencing).

> I understand that properties and categories should be differenced, but i am pretty much surprised there is no way of making a form or template which instead of properties, can use categories as information source.

This is not what I have said. You are free to use both categories or properties as first class citizen. I merely emphasized that input and post-processing need to be detached from each other and that a category and a property are to represent a different statement about an object (also in regards as to how it is encoded in RDF).

> Unluckily the only thing which this does to your form is writing a box with "name" which you can not even fill, so perhaps it was forgotten.

This was an example and was to demonstrate the difference between form and template usage/editing processing.

> Something that gives me hope, it that semantic forms has 2 options for it´s properties which are "category" and "categories", so perhaps someone has been trying to solve this issue.

I don't use SF therefore I can't make any comments on that.

> What is that SF talk?

See, SF.

19:00, 7 April 2015