Help:Annotation naming guideline

From semanticweb.org

Jump to: navigation, search

Semantic MediaWiki Docu

Also see the official documentation
for Semantic MediaWiki
at
semantic-mediawiki.org

Annotations

Semantic templates

Custom units

Annotation naming guide

Browsing and searching

Service links

Semantic search

Inline queries

External tools

Semantic Web

RDF export

Importing vocabulary

Ontology import

SPARQL endpoint

Installation

This is an unofficial guideline by SMW users. It does not necessarily reflect the opinion of the SMW developers.

Semantic annotation of articles can be done in any language or even with numbers. However, there are often many different ways to state the information; some are better and some are simply incorrect. The following guide should show you which information can get annotated and how to do so in the best way.

How to name properties

As a general rule, for computers, it doesn't matter how a property is named. Beside of this, humans need a intuitive way of naming properties. This is specially helpful during search.

A preferred way to do this is to use a noun or noun phrase for the name of a property. Use a verb to model events in time.

Examples of properties with values
[[First Name:=John]]
[[Age:=31]]
[[Date of birth:=1975-12-30]]
Examples of properties linking pages
[[Located in::Asia]]
[[President of::United States]]
[[Member of::European Union]]

Try to use a property that already exists; look inSpecial:Properties and browse similar pages.

Time-dependent facts

Another problem with verbs in properties is they imply a time. For example: "was president of" is not the same as "is president of". If you want to ask for all the presidents of the US over time you need to query both, the past and the current presidents. Using the Relation "president of" would avoid this problem, because it can get used for the current and the past presidents.

You can use n-ary relations to group a start date and end date with a property.

Choosing better names

(If Type:Boolean does not seem to work, see Test, the reason is probably that the enabling code is still commented out in the SMW 0.7 distribution file. Go to line 372 in includes/SMW_Datatype.php and remove the comment markup.)

As example a semantic annotation if a person is attractive or not may get named in one of the following ways:

Implementation as Boolean Attribute
[[HotOrNot::true]]
[[HotOrNot::false]]

The problem here is that the name is not well chosen. If you ask a friend "is this girl hot or not?" you demand for an answer like "she is hot" or "she is not hot". But when the answer is "yes" or "no", this doesn't fit to the question and therefore the question is not answered. That is why either the answer (a Boolean Type, which represents "true" or "false" mapping to "yes" or "no") or the question is wrong chosen.

Implementation as Relation
[[HotOrNot::Hot (slang)]]
[[HotOrNot::Not]]

This second example is prettier because it gives a precise answer to the question. But the drawback is that this solution allows a very big amount of unusable Answers, where only two possible answers are correct.

Choose a better Name
[[Pretty::true]]
[[Pretty::false]]

This solution fits best to the needs of the user. On the one hand the statement becomes clearer, the answer needs no mapping to get interpreted correctly, on the other this attribute can use a typed value; there appears a warning in the Factbox when the attribute is filled with anything other than "true" or "false".

The current President

In the section before we discussed how to Model the time a person was the President of the US. Using only "was president of" is not the best solution for all questions, because someone could ask for the presidents of the US in chronological order. Therefore you need the exact dates. For George Washington this could look like:

[[president since::1789]]
[[president till::1797]]

But this is even not good enough, because it says nothing about which kind of president the person was. In that example George Washington could have been the president of a chess-club. Therefore you need to use something like

[[president of United States since::1789]]
[[president of United States till::1797]]

which describes George Washington very well. The new property simply derive from the first one, which says, that the new property are a special kind of the old ones. When the user is now searching ie. for "president since" she will also find articles including "president of United States since". To express subclassing of properties correct use Property:subproperty of.

Personal tools