SMW notes: Difference between revisions
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
{{ | http://smwforum.ontoprise.com/smwforum/images/a/ad/Manual_SMW.pdf | ||
{{ | |||
http://smw.referata.com/wiki/Special:BrowseData/Tips | |||
(from mailing list) | |||
== Data design == | |||
- Create a top category for Semantic Classes. I called mine 'Categories'. | |||
It holds only categories used to define a 'Is-a' relationship. Doing so has | |||
at least two benefits : 1- You can do a query on your core content by | |||
restricting it to the 'Categories' level. 2- You can define other | |||
categories outside of that structure for whatever your system needs. | |||
http://smwforum.ontoprise.com/smwforum/index.php/Example:How_to_realize_a_range_constraint_for_a_property | |||
== MW tricks == | |||
=== Variables === | |||
You can make use of the VariablesExtension [1] and store the query (or its | |||
result? I'd like to know which one, but in the end it doesn't really matter) in | |||
a variable, which is helpful when you need the same query multiple times within | |||
a page. It looks like this: | |||
{{ #vardefine: some_variable_name | {{#show:{{PAGENAME}}| ?propertyname}} }} | |||
(silent) or | |||
{{ #vardefineecho: some_variable_name | {{#show:{{PAGENAME}}| ?propertyname}} }} (with output) | |||
Further down in the page you can write | |||
{{ #var: some_variable_name }} | |||
=== Specific searches === | |||
<nowiki> | |||
<inputbox> | |||
type=search | |||
width=30 | |||
namespaces=Help**,Wikipedia**,Template** | |||
searchbuttonlabel=Search help pages | |||
bgcolor=#cee0f2 | |||
break=no | |||
</inputbox> | |||
</nowiki> | |||
== Misc == | |||
=== Enable links in property values === | |||
$smwgLinksInValues = true; | |||
== Media == | |||
Neat talk on MW, with refs to SMW: http://www.youtube.com/watch?v=Ukytqe9pwDM | |||
[[Semantics]] |
Revision as of 19:24, 18 August 2009
http://smwforum.ontoprise.com/smwforum/images/a/ad/Manual_SMW.pdf
http://smw.referata.com/wiki/Special:BrowseData/Tips
(from mailing list)
Data design
- Create a top category for Semantic Classes. I called mine 'Categories'. It holds only categories used to define a 'Is-a' relationship. Doing so has at least two benefits : 1- You can do a query on your core content by restricting it to the 'Categories' level. 2- You can define other categories outside of that structure for whatever your system needs.
MW tricks
Variables
You can make use of the VariablesExtension [1] and store the query (or its result? I'd like to know which one, but in the end it doesn't really matter) in a variable, which is helpful when you need the same query multiple times within a page. It looks like this:
(silent) or
(with output)
Further down in the page you can write
Specific searches
<inputbox> type=search width=30 namespaces=Help**,Wikipedia**,Template** searchbuttonlabel=Search help pages bgcolor=#cee0f2 break=no </inputbox>
Misc
Enable links in property values
$smwgLinksInValues = true;
Media
Neat talk on MW, with refs to SMW: http://www.youtube.com/watch?v=Ukytqe9pwDM