błędy / nieścisłości / niedopatrzenia

Transkrypt

błędy / nieścisłości / niedopatrzenia
BŁĘDY / NIEŚCISŁOŚCI / NIEDOPATRZENIA
http://prolog.ia.agh.edu.pl/kwikis/plwiki/prolog:family:families
Family example
Introduction
This simple use case demonstrates how to use Prolog in PlWiki. PlWiki provides full SWI-Prolog
functionality so it is possible to define rules, [dodano przecinek] and store more complex
knowledge.
Suppose there is Smith family. Some information about this family is available here.
In addition to this, here are rules defining mother and father.
With this knowledge it is possible to “ask” PlWiki about some facts. For example:
• who is father in Smith family?
Here come some examples:
(…)
http://prolog.ia.agh.edu.pl/kwikis/plwiki/prolog:mediawiki:test
Queries
Now, when knowledge about cities and countries is stored in PlWiki it is possible to build queries,
combining categories, relations and attributes. The query language is simple and it should not be
hard to understand it.
http://prolog.ia.agh.edu.pl/kwikis/plwiki/prolog:usecase
Knowledge
There are four page types:
• city in “prolog:usecase:city” namespace,
• country in “prolog:usecase:country” namespace,
• peninsula in “prolog:usecase:peninsula” namespace,
• sea in “prolog:usecase:bookstore:sea” namespace. [(1)bookstore? coś chyba zła ta ścieżka]
[(2)w ogóle po co w prolog:uscase jest 'bookstore' jeśli tam są city, country, peninsula i sea?]
Each page type is defined using SMW syntax. For example:
• city:
Berlin is the capital city of [[capital_of::prolog:usecase:country:germany]]
[[category:city]]
• country:
Belgium is a country in Northwest Europe.
(…)
[(3)jakieś nl by się przydało do wypisywania/ opis (ostatnia linijka)? bo wygląda to tak: ]
prolog:usecase:country:denmarkprolog:usecase:country:norwayprolog:usecase:country:swedenprol
og:usecase:country:finland
http://prolog.ia.agh.edu.pl/kwikis/plwiki/prolog:bookstore
Bookstore example
Introduction
Here comes another use case. Suppose there is a bookstore system based on PlWiki, including
recommendation mechanism, which informs customer about suggested books.
There are four page types:
• genre in “prolog:bookstore:genre” namespace,
• publisher in “prolog:bookstore:publisher” namespace,
• author in “prolog:bookstore:author” namespace,
• book in “prolog:bookstore:book” namespace.
The most important namespace “prolog:bookstore:book” contains information about particular
books, and for example “bookstore:book:it” page source may look like following:
wiki_category('bookstore:book:it','book').
wiki_attribute('bookstore:book:it','title','It').
wiki_relation('bookstore:book:it','author',
'[skasowano ':' z tego miejsca]bookstore:author:stephen_king').
wiki_relation('bookstore:book:it','publisher'
,'bookstore:publisher:signet').
wiki_attribute('bookstore:book:it','date','1987').
wiki_attribute('bookstore:book:it','language',
'english').
wiki_relation('bookstore:book:it','genre',
'bookstore:genre:horror').
For example it is possible to get actual date (month) using Prolog and then list only books, marked
as recommended this month.
http://prolog.ia.agh.edu.pl/kwikis/plwiki/prolog:university
Simple Queries
Simple queries based on SMW query language, are placed on courses, lectures, lecturers and rooms
pages, and provide some useful context information. For example:
(…)
Rules
Basing on knowledge in PlWiki some rules were defined. Following rules are based on date/time
(see source of this page) predicates, and provided goals depend on time of day and day of week so
do not be surprised if goals are different :)
(...)
Summary
University example shows that PlWiki provides powerful environment, including full SWI-Prolog
syntax and built-in predicates, and libraries. PlWiki allows to combine SMW markup and Prolog
syntax, and it is one of most important advantages of this Semantic Wiki system.

Podobne dokumenty