{ExtensionsRepositories}
setting in your lib/LocalSite.cfg
like this:
$Foswiki::cfg{ExtensionsRepositories} = 'Foswiki.org=(http://foswiki.org/Extensions/,http://foswiki.org/pub/Extensions/);Local=(http://365847.689093.cn/Extensions/Testing/,http://365847.689093.cn/pub/Extensions/Testing/)';Read more about configuring Extension repositories
[[Property::Value]]
Semantic MediaWiki syntax
RENDERING
* Set SEMANTICLINKSPLUGIN_RENDERING = on
DEFAULT_PROPERTYWEB
* Set SEMANTICLINKSPLUGIN_DEFAULT_PROPERTYWEB = Applications/SemanticPropertiesSee #AboutDEFAULTPROPERTYWEB
META:SLPROPERTY
, see #Meta_Data).
Note | Example | Preview | # | Should get | |
---|---|---|---|---|---|
Semantic link | [[IsPartOf::UserDocumentationCategory]] |
IsPartOf::UserDocumentationCategory | |||
Semantic link with Foswiki-style link text | [[IsPartOf::UserDocumentationCategory][docs]] |
docs | |||
Semantic link with SMW-style link text | [[IsPartOf::UserDocumentationCategory|docs]] |
[[IsPartOf::UserDocumentationCategory | docs]] | ||
Non-semantic link | [[:IsPartOf::UserDocumentationCategory][docs]] |
docs |
SemanticLinksPlugin::PROPERTYNAME::Link
. This gives skin templates a chance to target only links using a specific property name. You might do this if your RDF needs to use multiple ontologies, or you can't easily transform property names consistently into RDF.
SemanticLinksPlugin::%SEMANTICLINKSPLUGIN_TMPL%::Link
, where SEMANTICLINKSPLUGIN_TMPL
is either a URL parameter or PreferenceSetting.
SemanticLinksPlugin::Link
SemanticLinksPlugin::Link
. Unless you override them with your own skin or AutoViewTemplatePlugin templates, these will come from templates/semanticlinksplugin.tmpl
.
TMPL:DEF{...} | Description |
---|---|
SemanticLinksPlugin::Link |
Build markup for an [[ordinary::link]] |
SemanticLinksPlugin::LinkWithtext |
Build markup for a [[link::with][text]] |
SemanticLinksPlugin::MissingLink |
Build markup for an [[ordinary::link]] to a non-existant topic |
SemanticLinksPlugin::MissingLinkWithtext |
Build markup for a [[link::with][text]] to a non-existant topic |
[[Example.Property::UserDocumentationCategory?query=part#AnchorPart][Example text]]Preview:
Example textThese tokens apply:
Token | Example | Description |
---|---|---|
$text |
Example text | text part of the link |
$property |
Example.Property | Property part (LHS of '::') |
$property(web) |
Example | Web part of the property |
$property(topic) |
Property | Topic part of the property |
$property(seq) |
3 | Values are counted against properties, starting from 1. Property name + sequence no. forms the unique name for each META:SLVALUE . Same as META:SLVALUE.propertyseq |
$value |
System.UserDocumentationCategory?query=part#AnchorPart | Value part (RHS of '::') |
$value(web) |
System | Web part of the value |
$value(topic) |
UserDocumentationCategory | Topic part of the value |
$value(query) |
query=part | Query part of the value |
$value(qquery) |
?query=part | Query part, prefixed with '?' |
$value(anchor) |
AnchorPart | Anchor part of the value |
$value(aanchor) |
#AnchorPart | Anchor part, prefixed with '#' |
SemanticLinksPlugin::LinkWithText
TMPL:DEF
contained within System.SemanticIsPartOf.
[[SemanticIsPartOf::UserDocumentationCategory?query=something#anchor][Example text]]Preview:
Example text
SemanticLinksPlugin::MyRDF::LinkWithText
used from the property topic
[[System.SemanticIsPartOf::System.UserDocumentationCategory][User documentation]]Previews:
SemanticLinksPlugin::System.SemanticIsPartOf::LinkWithText
used from the templates/view.semanticlinksplugindcdemo.tmpl
file
[[System.SemanticIsPartOf::System.UserDocumentationCategory][User documentation]]Previews:
SEMANTICLINKSPLUGIN_DEFAULT_VALUEWEB
PreferenceSettings [[Cite::Duke2006b]]This will only work if the bibliography topic Duke2006b exists in the same web as the topic making the reference. However, it's usually desirable to have a dedicated web for holding bibliography topics, but then the user would have to type:
[[Cite::MyProject/Bibliography.Duke2006b]]This can be solved by adding a SEMANTICLINKSPLUGIN_DEFAULT_VALUEWEB preference on the Cite topic, as follows:
* Set SEMANTICLINKSPLUGIN_DEFAULT_VALUEWEB = MyProject/BibliographyWith this in place, bibliography topics can exist in a dedicated subweb, and the user can still write
[[Cite::Duke2006b]]to access them.
SEMANTICLINKSPLUGIN_DEFAULT_PROPERTYWEB
PreferenceSettings * Set SEMANTICLINKSPLUGIN_DEFAULT_PROPERTYWEB = Applications/SemanticPropertiesin Main.SitePreferences With this setting, and the
Cite
property topic stored in Applications/SemanticProperties
web, you may use [[Cite::...]]from anywhere in the wiki.
Frogs [[Eat::Flies][eat flies]], [[Eat::Mosquitos][mosquitos]] and are [[PreyOf::Snakes][preyed on by snakes]].on save, gives:
%META:SLPROPERTY{name="Eat" num="2"}% %META:SLVALUE{ name="Eat__2" property="Eat" propertyaddress="System.Eat" propertyseq="2" propertyweb="System" value="Mosquitos" valueaddress="System.Mosquitos" valuetopic="Mosquitos" valueweb="System"}% %META:SLVALUE{ name="Eat__1" property="Eat" propertyaddress="System.Eat" propertyseq="2" propertyweb="System" value="Flies" valueaddress="System.Flies" valuetopic="Flies" valueweb="System"}% %META:SLPROPERTY{name="PreyOf" num="1"}% %META:SLVALUE{ name="PreyOf__1" property="PreyOf" propertyaddress="System.PreyOf" propertyseq="1" propertyweb="System" value="Snakes" valueaddress="System.Snakes" valuetopic="Snakes" valueweb="System"}% %META:SLVALUE{ name="IsPartOf__1" property="IsPartOf" propertyaddress="System.IsPartOf" propertyseq="1" propertyweb="System" value="UserDocumentationCategory" valueaddress="System.UserDocumentationCategory" valuetopic="UserDocumentationCategory" valueweb="System"}%A complete list of properties on a given topic may be obtained using:
%QUERY{"slproperties.name"}%Preview: A complete list of values for a given property may be obtained using:
%QUERY{"slvalues[property='Eat'].value"}%Preview: And all values of all properties on the current topic could be rendered using:
%FORMAT{ "%QUERY{"slproperties.name"}%" type="string" format="$percentFORMAT{ \"$percentQUERY{\"slvalues[property='$item'].value\"}$percent\" type=\"topic\" header=\" * $item$n\" format=\" * [[$dollarweb.$dollartopic][$dollartopic]] created $dollarcreatedate\" }$percent" }%Preview:
META:LINK
MetaData containing (almost) all links contained in the topic content. The schema is as follows: META:LINK
links
name
- numeric index, in order of appearance in the topic content
address
- the (absolute) path in the link
scope
- internal or external
type
- autolink, semantic or bracket
web
, topic
- for links of internal scope only
META:LINK
.
%WEB%.%TOPIC%
will be stored as Extensions/Testing.SemanticLinksPlugin
.
WebPreferences (or %WEBPREFSTOPIC%) produces: * %META:LINK{name="1" scope="internal" type="autolink" web="System" topic="WebPreferences" address="System.WebPreferences"}% [[PreyOf::Snakes]] produces: * %META:LINK{name="2" scope="internal" type="semantic" web="System" topic="Snakes" address="System.Snakes"}% [[SemanticIsPartOf]] produces: * %META:LINK{name="3" scope="internal" type="bracket" web="System" topic="SemanticIsPartOf" address="System.SemanticIsPartOf"}% http://foswiki.org/Support/SemanticLinksPlugin produces: * %META:LINK{name="4" scope="external" type="autolink" address="http://foswiki.org/Support/SemanticLinksPlugin"}% [[http://www.w3.org/RDF/Validator/]] produces: * %META:LINK{name="5" scope="external" type="bracket" address="http://www.w3.org/RDF/Validator/"}%
%SEARCH{ "links[address='%WEB%.%TOPIC%']" type="query" web="%SYSTEMWEB%" header="Topics that link to %WEB%.%TOPIC%:" }%
<noautolink> * Links to other topics: %FORMAT{ "%QUERY{"links[scope='internal'].name"}%" type="string" header="$n" format=" * =$percntQUERY{\"links[name='$item'].address\"}$percnt= - $percntQUERY{\"links[name='$item'].type\"}$percnt link" }% * External links: %FORMAT{ "%QUERY{"links[scope='external'].name"}%" type="string" header="$n" format=" * =$percntQUERY{\"links[name='$item'].address\"}$percnt= - $percntQUERY{\"links[name='$item'].type\"}$percnt link" }% </noautolink>Preview:
rest
script to re-save topics making use of semantic links across one or more webs. The available options are: updateweb
- the web to update. all
updates all webs.
updatetopic
- the topic to update. If omitted, updates all topics.
recurse
- on or off. Recurse into subwebs.
www-data
(default on Debian systems)
/path/to/foswiki
cd /path/to/foswiki sudo -u www-data bin/./rest /SemanticLinksPlugin/reparse -updateweb System
[[ISBN::2134567]]
could have a template in the ISBN property topic which renders some specially styled <span>
tag to enable some jquery code to go out and resolve the ISBN into publisher, author, book title... in the browser.
{{#set ....}}
syntax at this point
[[Foo::Bar|label]]
isn't understood by WysiwygPlugin, so the syntax breaks TML tables
configure
, then you can still install manually from the command-line. See http://foswiki.org/Support/ManuallyInstallingExtensions for more help.
Author: | Foswiki:Main.PaulHarvey |
Copyright: | © 2010-2011, Taxonomy Research & Information Network, Foswiki Contributors |
License: | GPL (GNU General Public License) |
Release: | 2.3.0 |
Version: | 13021 (2011-11-08) |
Change History: | |
08 Nov 2011 (2.3.0) | Foswikitask:Item11243 - Breaking compatibility - Replaced [[SemanticLinksPlugin_DEFAULTWEB::...]] notation with SEMANTICLINKSPLUGIN_DEFAULT_VALUEWEB and introduced SEMANTICLINKSPLUGIN_DEFAULT_PROPERTYWEB PreferenceSettings |
06 Jul 2011 (2.1.2) | Foswikitask:Item10913 - Fix missing init call in the reparse REST handler where, unless you only reparse an individual topic, pollutes topics with lots of bogus properties/values/links |
17 Jun 2011 (2.1.1) | Foswikitask:Item10887 - Fix incorrect propertyseq values |
16 Jun 2011 (2.1.0) | Foswikitask:Item10884 - Implement a 'meta-property' for property topics to control default web context on links only containing a topic name - Removed META:SLPROPERTY.values key. Query META:SLVALUE.value instead. - Renamed META:SLVALUE.anchor key to META:SLVALUE.fragment . - Removed META:SLVALUE.query and META:SLVALUE.text keys. - META:SLPROPERTY.name key is now always the topic part only. Web prefixes are stripped. - Added valueweb , valuetopic , valueaddress , propertyweb , propertytopic , propertyaddress keys to META:SLVALUE type. |
10 May 2011 (2.0.1) | Foswikitask:Item9961 - Implement $property(seq) token & documented |
07 May 2011 (2.0.0) | Foswikitask:Item9961 - Breaking compatibility - Deleted META:SLPROPERTIES . Use %QUERY{"slproperties.name"}% for a list of property names - Renamed META:SLPROPERTYVALUE to META:SLVALUE . Use the rest script to update your topics. - Renamed slpropertyvalue and slproperty to slvalues and slproperties . You will need to re-write your queries! - Changed template tokens from $valuefoo to $value(foo) format - Added META:LINK metadata to allow QuerySearch of topic backlinks - Added a rest script to support bulk updating topics with backlink META and the new META:SL... schema |
06 May 2011 (1.2.0) | Foswikitask:Item9961 - Fix always saving an SLPROPERTIES even when no semantic links present; re-work token parser |
06 Jan 2011 (1.1.0) | Foswikitask:Item9961 - Rename SEMANTICLINKSPLUGIN_ENABLED to SEMANTICLINKSPLUGIN_RENDER; default to on |
05 Nov 2010 (1.0.3) | Foswikitask:Item9948 - Fix registerMETA bug, QUERY examples; fix template bug |
03 Nov 2010 (1.0.0) | Foswikitask:Item9897 - Initial version |
Home: | http://foswiki.org/Extensions/SemanticLinksPlugin |
Support: | http://foswiki.org/Support/SemanticLinksPlugin |
I | Attachment | Action | Size | Date | Who | Comment |
---|---|---|---|---|---|---|
md5 | SemanticLinksPlugin.md5 | manage | 180 bytes | 08 Nov 2011 - 12:43 | PaulHarvey | |
sha1 | SemanticLinksPlugin.sha1 | manage | 204 bytes | 08 Nov 2011 - 12:44 | PaulHarvey | |
tgz | SemanticLinksPlugin.tgz | manage | 28 K | 08 Nov 2011 - 12:43 | PaulHarvey | |
zip | SemanticLinksPlugin.zip | manage | 31 K | 08 Nov 2011 - 12:43 | PaulHarvey | |
EXT | SemanticLinksPlugin_installer | manage | 4 K | 08 Nov 2011 - 12:43 | PaulHarvey | |
png | dcdemo.png | manage | 8 K | 03 Nov 2010 - 05:54 | PaulHarvey |