Help:Relation

'''This documentation page is outdated. Please refer to the Semantic MediaWiki homepage for current information.'''

Relations between articles "::"
With this extension installed MediaWiki offers a new feature, it allows you to give links a type. Instead of merely linking from the article San Diego to California, you can now &mdash; if you like &mdash; additionally state the kind of relation between San Diego and California. We can probably agree that San Diego is located in California. You can state this fact by writing in the San Diego page this fine city is in is located in::California ...

Before the linked article name, you give the type of the relationship, separated by two colons.

You can use any string for the relation type, but it would be great to use the same strings as other people, much like categories. Consistent relations let users make smarter searches of Wikipedia; instead of every article that links to California, they can, for example, search for every article that is located in California.

The Special:Relations page lists every relation. Each relation type may have its own page in the Relation: namespace that describes it, for example Relation:Is located in. For a list of the relations that have such pages, use the all articles query page to display articles in the Relation namespace.

Hint: 
 * If you want to define a relation which is not visible in the Text, simply rename it to a space:
 * 


 * Feel free to check out the Bugs Page to report problems
 * Relations can be chained. Therefore instead of:
 * is a::fruit use as::fruit
 * you can say:
 * is a::use as::fruit


 * Take a look at existing schemas like WikiOnt, GeoURL, Dublin Core, FOAF and SKOS to compare them with the proposed implementation in this wiki.
 * If you want to Model in different times (past/present/future) you maybe need to create new Attributes.

Example: has capital | is capital of had capital | was capital of Note: Maybe this issue can be solved better by a powerful dictionary containing a definition for will have, has and had and deriving them from future, past and present. But the syntax gets more strict (Attributes need contain one of "has", "is", or similar), and it must be extensible also for other Languages (ie. French uses 7 kinds of times, which results in multiple inheritance). This makes it very complex to implement such a thing in software.

Attributes ":=" are relations to values
Relationships to things that are not articles can be stated by using attributes. If you know that the population of San Diego is 1,305,736, you can state this fact by writing in the San Diego page:

the 2005 census estimated its population as population:=1,305,736

You put the value inside , and before it you give the type of the attribute, separated by :=

The Special:Attributes page lists every attribute. You can also use the all articles query page to display articles in the Attribute namespace.

You can search on attributes, such as population.

Attributes can be chained to set two attributes to the same value, e.g.: the bases of the towers were squares length:=width:=208 feet on a side

Attribute and Relation are analogous to literal and URI reference respectively in RDF.

see also: Attribute:true title, dct:Box, GeoURL

Datatypes
Wikipedia needs to know the type of an attribute. This is especially true of attributes whose values have dimensions and units, such as area.

So you must create an page in the Attribute: namespace for an attribute, and in this specify its datatype using the Relation:Has_type. For example, Attribute:Area has has type::area The Special:Types page lists the datatypes implemented in Semantic MediaWiki. We are working to extend this to all physical types (speed, density, energy, etc.). There is a lot of discussion about this in Built in Types. While waiting for a particular datatype to be implemented with the physical dimensions you need, you can use Type:Float and provide units (that won't be recognized), or use Type:String.

Each datatype may have a page in the Type: namespace, for example Type:Area. These type pages are just for documentation, e.g. to tell users which syntax is accepted and which units will work. Conversely, creating a new Type: page does certainly not create a new datatype!

Future Work
This Wiki is still in development and meant to be subject of ongoing research and dicussion. The following is a Overview of special Syntax which is currently not implemented and open for discussion.

Infoboxes
Infoboxes might add semantic Information to an article in an transparent way. Let's define a City-Infobox with the following simple code: Now we can use this Infobox like in the following Example:

Note: this approach can handle only simple Datatypes. If it would need to handle more than one Value for the  Attribute, we need either Arrays or can't use this example.

Built in Types
To make the use of types easier, we can introduce built-in types. This matches the current implementation best which doesn't care about Type-Definitions and should make the live of Wikipedians easier who want to define a new Attribute and don't want to care about things like Datatypes. Also this technique will be easier to implement and therefore leading to a release-date without the need to take care at things like user-side Type definitions. Also by making it possible to user fixed data-structures it will be easier to implement seach based on this types. Built-in-Types are recognized by a parser which tries to get the meaning from the structure of the string. We define the following examples: Example: String:="This is a String" Number:=3,678.5 * 10^3 Dimension:=385.56 miles s^(-2)/J Electron Configuration:=3d6 4s2 Link:=Sun.Mass
 * Strings
 * Numbers
 * Dimension (Numbers + Units)
 * Electron-Configuration of Atoms
 * (semantic) Links (optional)
 * others if needed

see also: Built in Types

Vectors and Matrices
has Vector:={1}{2}{3}{4} has Matrix:= see also: Vector

Enumerations
Proposal for definition of Enumerations: enumeration::{color:Red}{color:Green}{color:Blue}

Another Example can be found at owl:oneOf, showing a similar Technique using OWL and Autolinking.

Patterns
Proposal for use of Regex-Patterns: [[has Type::Pattern("[a-zA-Z0-9]{5}") This can be usefull ie. for defining Currency.

Note: Currency have to get implemented per-language. Note: Flags could get implemented as an Enumeration of Boolean Values.

Summary

 * Good
 * Attributes can be bound to Datatypes.
 * Enumeration types
 * Nested types
 * Regex patterns based types
 * Negative
 * Regex-Patterns possibly need special coding to get interpreted right.
 * Requires Implementation of Namespaces
 * Can get complex to implement

see also: Dublin Core, dct:Box, WikiOnt

Units
see also: Units

Ranges
A range is defined when a value is double-defined as the distance between minimum and maximum. was capital in:=1530 was capital in:=1905 this means that the city was a capital from 1530 till 1905. This technique can also get in use when defining Polygons: Area:=  {point:={3}{5}}   {point:={-3}{6}}    {point:={-2}{-5}}    {point:={2}{-6}} Another possibility would be to create complex Types: {from date:=1993}{to date:=2001}{was president of::USA}

see also: Attribute:Date of birth, Attribute:Color, and Attribute:From.

We should extend the idea of this range to

Attributes of Relations
Relations between articles may need attributes to show the intensity of the relation. At the moment, you can only show the type of relation. For example, consider when you want to say:

Computer X connects to Internet at 256kbps - You can say that Computer is related to the Internet by being connected to it with the current implementation.

(Some car model) contains 7 seats - Currently, you can only say that (some car model) contains seats, not how many.

This can actually be tied into the date ranges for the president examples. It would be best if we could tie attributes into relations. Using the same sort of syntax would work very well.

Escape Sequences
Articles may contain the characters ']]' or ':' within title. So we need a kind of Escape-Sequence.

is a::really unlikelycharacter sequence]]

We could use a C-like escape sequence:

is a::really unlikely/character sequence]]

When you now want to write a '/' character, you can double it or use an '@' character:

is a::http:////tempuri.org//extern_resource// is a::@http://tempuri.org/extern_resource/ true title:=/@Work


 * Good
 * Solves the Problem of Escape Sequences
 * Syntax related to common Programming Languages like C#
 * Negative
 * More complex Syntax

Namespaces
Namespaces are very important in RDF for including existing Schemas from the Web. Namespaces may defined as special Articles (ie. named Namespace:dc) and derived from an Namespace:

is same as::@http://purl.org/dc/elements/1.1/


 * SMW has a special property Property:Equivalent URI to specify such equivalences; or you can just import and reuse an external vocabulary -- Skierpage 03:59, 22 December 2007 (CET)

A similar techique could also replace Interwiki links. Take the Article Apple and insert: translation:=de:Apfel While Namespace:de is defined as: is same as::@http://de.wikipedia.org/wiki/

see also: InterSchema

Implicit Derivation
Implicit Derivation means that special Kind of articles can automatically derived from a special Type.

This can apply to the following:
 * Special Pages
 * Help
 * Users
 * Attributes
 * Types
 * Namespaces
 * Image, Audio, and Video Content

And all articles derive at least from Article, which itself is a wiki:Text, which is a Object.

Search
Improved Semantic Search.

Backlinks
Relations can be a two way thing (symmetric, or bidirectional). When we use the syntax is same as::&hellip; this applies to both, the current article and the target. Also some relations have counterparts like is capital of and has capital This counterpart could automatically be created. But we need a syntax to describe this. Examples are in owl:inverseOf and OWL.

Automatic simplifying of Categories
Take a User that defines that he  and he. We also define a relationship Germany  and the relationship that Relation:comes from is a stronger binding than. A semantic reasoner should now be able to decide that the statement  is obvious and can remove it.

Note: A simple but dirty approach (Hack) would be to use Relation:is same as which has the same effect, even the meaning is a bit different.

Note: Because this functionality will need a lot of computing Resources - but doesn't need to run in realtime – it should run as separate thread with lower Priority. see also: owl:equivalentProperty

Context
To solve the Problem of Ambiguity, we could introduce the Relation:context of in combination with Attribute:true title. This will make it possible to search for the Word "Mars" and we will get a Search-Result like: The God Mars in roman mythology The Planet Mars in solar system So, we have implicit disambiguation in the search-result.

Translations
see also: User talk:GerardM