Possible internal API for metadata in support of a semantic wiki. Please edit as necessary, this document is only a draft.
Labels and Types
All labels have a specific type. These methods help you access the type and label data.
Add typed label
A method to add metadata labels/names/predicates.
-
need to specify type when adding a label
-
default type is a string
-
inline editing of a wikipage
-
metadata button with custom interface
Edit label type
A method to modify the type of a label/name/predicate.
-
default type is a string
-
a special page (changing this makes many wiki-wide changes)
-
possibly admin only? vandalizations would span multiple pages and/or wikis
Retrieve labels
A method to retrieve metadata labels/names/predicates that match a specific search criteria
-
all labels in the db
-
all labels on a page
-
all my labels (would require db schema changes)
Metadata
Metadata is really the whole ball of wax. It's the names, the values, and the types.
Add metadata
A method to add metadata about the current wiki page.
-
inline editing of a wikipage
-
metadata button with custom interface
Edit metadata
A method to modify metadata about the current wiki page.
-
quick edit
-
inline editing?
-
metadata button with custom interface
Retrieve metadata
A method to retrieve metadata rows that matches a specific search criteria.
-
need an option to show/hide/default value if no results are found
-
post-processing (ie hooks like average, count, sum) results
-
results can be structured (for example area_code=916 and phone_number=123-4567 would display as (916) 123-4567)
-
results can be multi-row so there should be a way to format as table, ordered list, unordered list, paragraphs, headings, etc
-
allow access to the source pages (ie show me a list of all restaurant pages that serve vegan food)
-
output as xml/rdf (would enable displaying results on a google map via their api)
Examples
The following are examples for retrieving and formatting metadata stored in the database.
No results found
Examples showing the different ways to handle a search where no results are found.
-
[MetaSearch("label=does_not_exist")] displays: nothing
-
[MetaSearch("label=does_not_exist","no search results found :(")] displays: no search results found :(
Using Hooks
Examples using the various hooks.
-
insert example using sum()
-
insert example using avg()
Structured result
Note: we could also handle this via hooks (ie build a hook that outputs a phone number).
-
[MetaSearch("label=(country_code|area_code|phone_number)","+<country_code> (<area_code>) <phone_number>")] displays: +1 (916) 123-4567
Multi-row results
-
[MetaSearch("(label=tag)","no tags found","cloud")] displays: a tag cloud or no tags found
Metadata from another page
-
[MetaSearch("(page=Delta of Venus&label=address)"] displays delta of venus' address
Metadata from other pages
-
[MetaSearch("(page=*&label=business_type&value=restaurant)+(page=*&label=food_type&value=vegan)","no results found","unordered")] displays: an unordered list of links to wiki pages that are classified as a restaurant and serve vegan food or no results found
Comments:
Note: You must be logged in to add comments
There will still be a search / advanced search interface that allows the casual person to query for things, right? This is just the internal wiki API?
I do think an advanced search interface would be nice for users to have access too. In fact for performance reasons, some of this reporting stuff might want to be offloaded to another server which is running a read-only DB. The simple search interface (ie only a textbox and button) could support some google-like advanced searches (ala business_type=restaurant) As far as the API goes I'm expecting these functions to first be implemented for internal purposes (ie macros and other sycamore-centric reasons). Later there can be an external API for other websites to link into sycamore's database and extract out metadata stored inside. —Sc0ttBeardsley