Welcome to the Virtual Education Wiki ~ Open Education Wiki
Help:Concepts
Update
It is particularly useful in Virtual Education Wiki that Concepts can include OR functions.
For example the page
[[Concept:Australia]]
is made up of three categories:
[[Category:Australia||New Zealand||Papua New Guinea]]
where the || (pair of pipe symbols) is an OR function. Thus any page in any one (or more) of the underlying categories will end up in the Concept.
Original entry
The text below is edited from https://www.semantic-mediawiki.org/wiki/Help:Concepts
Concepts are Semantic MediaWiki (SMW) Semantic search queries that are stored on dedicated pages. These pages can be viewed as "dynamic categories", i.e. as collections of pages that are not created manually, but that are computed by SMW from the description given by a query. An example could be the concept of European cities. In traditional Wikipedia:MediaWiki installations, one may have a category called European cities that holds all such cities. In SMW, one would instead define the concept "European cities" by saying that it contains all cities that are located in Europe. No city page needs to be changed, and yet one can create many concepts about cities (such as "capital", "Italian city", or "large coastal city located at a river").
Creating a concept
A concept is a page in the Concept: namespace that is always described by a semantic query, as explained in Help:Semantic search.
For example, a concept called "Concept:Semantic MediaWiki Cons 2012" describes Semantic MediaWiki Cons in 2012. Its Concept page]] contains the following text to do that:
{{#concept: [[Category:Event]] [[Has planned start::> Jan 1 2012]] [[Has planned finish::< Dec 31 2012]] |Semantic MediaWiki Cons in the year 2012 that have been announced on this wiki. }}
The parser function #concept
is used to define concepts.
Its first parameter is a concept definition.
It selects pages by applying three selection steps:
- the page has to be in the Category:Event category
- the Property:Has planned start has to have a value later than 2012-01-01
- the Property:Has planned finish has to have a value earlier than 2012-12-31
Its second parameter is a short text that describes the concept. This description is optional and can also be left away. It is exploited in some uses of concepts in Semantic MediaWiki to have a concise short description of the concept (e.g. as a default description in Inline queries#Result_formats|RSS feeds). The complete concept page will then show this data, and give a preview of the results.
It is possible to have other content on the concept page as well. Any normal wiki text can go before and after the use of #concept
but it will not have any effect on the definition of the concept. The #concept
parser function can only be used on pages in the Concept: namespace, and it can only be used once on each such page.
Using a concept
Concept pages as such can be browsed to view the contents of some concept, similar to category pages. But they can also be used in other semantic queries just like categories. For example, the following query would show all pages in the above concept of events and show where the event was located:
- Syntax
{{#ask: [[Concept:Semantic MediaWiki Cons 2012]] |?Has location=Location |format=table |headers=plain |mainlabel=Event }}
- Result
Note that this would look almost the same if we would have a category called "Semantic Web events 2012". Therefore, concepts are also like stored queries that can be reused as a kind of variable in other queries if desired.
Inline queries may also use concepts, and in some cases even the concept definition is used to beautify an output. Concept definitions are also included in SMW's RDF export]] in form of OWL class descriptions, so that other Wikipedia:Semantic Web tools can download and reuse the concept descriptions.
Concepts with Page Forms
With the Template:Extend you can use concepts for:
- Defining the set of values suggested for Input_types#Setting_values_and_mappings|autocompletion.
- As a "human-readable" argument in a Page_Forms/Creating_query_forms|query form.
Nesting concepts
Since Release|2.1.0 it is possible to use concepts within concepts, i.e. if one creates concepts Concept:Talk as
{{#concept: [[Has_talk_type::+]] |Talks of different types }}
and
{{#concept: [[Has_talk_type::Tutorial]] |Tutorial }}
then Concept:SMWCon with
{{#concept: [[Concept:Event]] [[Has conference type::SMWCon]] |Semantic MediaWiki Conferences }}
and concept Concept:SMWCon Talks with
{{#concept: [[Concept:Talk]] [[Has conference::~SMWCon*]] |Talks at an SMWConference }}
You can also combine concepts e.g. Concept:Tutorial at SMWCon
{{#concept: [[Concept:SMWCon Talks]] [[Concept:Tutorial]] |Tutorials at SMW Conferences }}
Caching Concepts
To improve performance, a site administrator should implement concept caching on the wiki.
> Help:Index
>> Main Page