Difference between revisions of "Using"

From Fiamma
Jump to navigationJump to search
m (Pchr8 moved page Searching to Using)
Line 14: Line 14:
 
//todo: write a small plugin to automate at least partly all this.
 
//todo: write a small plugin to automate at least partly all this.
  
 +
For this I created the [[Template:Basic]], to be used like <pre>{Basic|l|t|c|o}</pre>
  
 
Other examples:
 
Other examples:

Revision as of 19:22, 8 December 2016

Making content available to search

Two main properties are Property:L the link (if there's one of them) and Property:o (if there's only one link in the page, the main one). To be used thus:

{{#set:
 o=true
 |l=https://www.fastcodesign.com/3043041/evidence/why-our-brains-love-high-ceilings
 |c=8
 |t=The page title
}}

Where c is the complexity of a page, from 1 to 10, and t is the page title as stated in the link. All this to aid searching later.
//todo: write a small plugin to automate at least partly all this.

For this I created the Template:Basic, to be used like

{Basic|l|t|c|o}

Other examples: https://www.semantic-mediawiki.org/wiki/Help:In-text_annotation details In text annotations, things like

[[Is capital of::Germany]]

If I want to do it quietly, it'll be thus:

{{#set:
 Has population=3,396,990
 |Has country=Germany
}}

Searching

The search page for structured queries is Special:Ask. More here: https://www.semantic-mediawiki.org/wiki/Help:Semantic_search

[[:+]] limits to main namespace. (No "Property:*" pages).

Page names

[[Brazil||France||User:John Doe]]
[[~John*]]

Based on values

Selecting pages: https://www.semantic-mediawiki.org/wiki/Help:Selecting_pages

[[Category:Actor]] 
[[born in::Boston]] 
[[height::180cm]]

Logic

A space is AND.

* || is for disjuncting inside a query (values, property names)
*  OR  is for parts of a query.

For example: [[Category:Musical actor]] OR [[Category:Theatre actor]] == [[Category:Musical actor||Theatre actor]]

Wildcards

[[born in::+]]

returns all pages that have any value for the property «born in».


Comparators

Placed after :: in property conditions.

  • >> and <<: "greater than" and "less than"
  • > and <: "greater than or equal" and "less than or equal" by default, but "greater than" and "less than" if $smwStrictComparators = true;
  • and : "greater than or equal" and "less than or equal"
  • !: "not" ("unequal")
  • ~: «like» comparison for strings
  • !~: «not like» comparison for strings

Like, not like

In a like condition, one uses '*' wildcards to match any sequence of characters and '?' to match any single character. For example, one could ask [[Address::~*Park Place*]] to select addresses containing the string "Park Place", or [[Honorific::~M?.]] to select both "Mr." and "Ms.".

Subqueries

[[Category:Actor]] [[born in::<q>[[Category:City]] [[located in::Italy]]</q>]]


Meta Reference Personal knowledge management Good