Comparing revisions for Semantic Wiki. View full history.
|
Revision: 1 Semantic WikiEdgeWiki supports semantic markup and querying similar to that used by Semantic MediaWiki (“SMW”). Each wiki page will have any number of relationships (SMW: “properties”). Each relationship will have a name (e.g. “capital of”, “birth date”) and a value. The value can be another wiki page (e.g. “Germany”), a simple type (e.g. string, date, geocoordinate), or a complex type (e.g. “has degree”). Each instance of a complex type can have its own set of relationships (e.g. “has degree” might have “school”, “major”, and “graduation date”). MarkupRelationships to other wiki pagesTo create a relationship to another wiki page, you simply add the relationship name to a normal wiki link, separated with a double-colon ( Berlin is the capital of [[capital of::Germany]]. If the link displays different text than the title of the wiki page, we use typical EdgeWiki syntax. Berlin is the capital of [[this country >> capital of::Germany]]. If you don’t want to create a link to the wiki page, you can use the Berlin is the capital. {{?set capital of::Germany}}
Some properties support multiple values; multiple hyperlinks and/or Rome was the capital of the [[capital of::Roman Empire]] and is now the capital of [[capital of::Italy]]. Simple properties (relationships to simple values)Simple properties use basically the same syntax. I was born on [[birth date::June 19, 1975]]. In this case, even though the hyperlink syntax is used, “June 19, 1975” will not be rendered as a hyperlink. Complex properties (relationships to complex values)If “has degree” or “employment” is a complex property with properties of its own, use hierarchical syntax as follows. John Smith was granted an [[has degree::degree::MS]] in [[has degree::major::Computer Science]] on [[has degree::degree date::June 3, 1999]]. He has been employed by [[employment::employer::Logos Bible Software]] since [[employment::hire date::July 1, 2006]]. For complex properties that can be specified more than once, use a disambiguating identifier after the property name, separated by a single colon ( John Smith was granted a [[has degree:1::degree::MS]] in [[has degree:1::major::Computer Science]] and [[has degree:1::major::Mathematics]] on [[has degree:1::degree date::June 3, 1999]]. John Smith was also granted a [[has degree:2::major::Basket Weaving]] [[has degree:2::degree::PhD]] on [[has degree:2::degree date::June 3, 2004]]. He was initially employed by [[employment:1::employer::Taco Bell]] from [[employment:1::hire date::June 4, 2004]] to [[employment:1::termination date::June 15, 2006]], but now works for [[employment:2::employer::Logos Bible Software]]. Defining relationshipsTo define relationships, we create a special page that describes the relationships in one or more tables. (Multiple tables are not necessary but can be used to help readers find the relationship.) Tables must have a heading row with headings for Name and Type and optionally Description and RDF Type. ? SemanticRelationships
! Semantic Relationships
!! Nations
|** Name | Type | Description |
| capital of | page | The capital of the nation. (See [[Capitals of Nations]].) |
!! Degrees
|** Name | Type | Description |
| has degree | complex | A degree of the person. |
| degree | string | The degree. |
| major | page | The major. |
| degree date | date | The date that the degree was earned. |
!! Misc
|** Name | Type | Description | RDF Type |
| {{?semrel description}} | string | | {{~ {http://purl.org/dc/elements/1.1/}description}} |
| {{?semrel author}} | page | | {{~ {http://purl.org/dc/elements/1.1/}creator}} |
If there is a page link in the description, it becomes the official page for that relationship. Supported Types
Built-in Relationships
QuerySyntaxThey query syntax is based on SMW’s (http://semantic-mediawiki.org/wiki/Help:Selecting_pages). Queries are made up of a series of conditions, followed by a series of parameters joined by |. Conditions are logically ANDed together. Parameters affect the presentation of the query results. Get the pages with a relationship [[department::Development]] Format the results as an unordered list. [[department::Development]] | format=ul Get the pages with a relationship [[department::Development]] [[gender::male]] | format=ul Get the pages with a relationship [[department::Development]] [[degree::+]] Use [[department::Development]] | ?department=Dept Comparators
Supported Parameters
Supported Output Formats
Values QueryTo get all the values of a given relationship, supply exactly one query condition with the has value ( [[department::+]] | values Relationships QueryTo get all the relationship in use, use the | relationships To get all the relationships in use for a set of pages matching some condition, specify that condition. [[department::Web Development]] | relationships Complex Relationship QueriesFind all pages having the semantic property “employer” with the value “Logos Bible Software”: [[employer::Logos Bible Software]] Find all pages having the complex semantic property “employment” with its own property “employer” with the value “Logos Bible Software”: [[employment::employer::Logos Bible Software]] Find all pages having the complex semantic property “employment” with its own property “employer” with the value “Logos Bible Software” and that same “employment” property has a “hire date” property value greater than Jan 1, 2000: [[employment::employer::Logos Bible Software]] [[employment::hire date::>1/1/2000]] Full-Text QueriesFind pages with an “employer” property and page text containing “software”: [[employer::+]] [software] Inline QueriesAsk MacroUse the {{?ask [[employer::Logos Bible Software]] | ?hire date | format=ul}}
Queries may be split across multiple lines by using a section. {{{?ask
[[employer::Logos Bible Software]]
| ?hire date
| format=ul
}}}
Semrel MacroUse the {{?semrel employer}}
URL QueriesQueries can be passed to the ad-hoc query page via the JSON ResultsThe results can be returned as JSON by adding {"Results":[{"Page":"John Smith","hire date":"7/1/2006"},{"Page":"Harry Jones","hire date":"8/15/2006"}]}
A callback JavaScript function can be passed with the processData({"Results":[{"Page":"John Smith","hire date":"7/1/2006"},{"Page":"Harry Jones","hire date":"8/15/2006"}]})
Feed ResultsThe results can be returned as an Atom or RSS feed by adding iCalendar ResultsThe results can be returned as an iCalendar file or feed by adding An events is a complex relationship with a relationship named John Smith was born [[birth::date::7/29/1979]].
{{?set birth::recurrence::yearly}}
|
Welcome, Guest! (sign in)