加藤 文彦 fumihiro@sfc.keio.ac.jp
<html lang="ja"> <head> <meta http-equiv="Content-Type" content="text/html; charset=EUC-JP"> <title>ほげほげのページ</title> </head>
(PICS-1.1 "http://example.org/pics-service"
by "Fumihiro Kato"
for "http://w3.org/PICS/"
ratings (age 11))
<大学 name="慶應義塾大学">
<キャンパス name="SFC">
<学部 name="総合政策学部">
<学科 name="総合政策学科" 終了学年="4" 学年1="true" 学年2="true" 学年3="true" 学年4="true" 学年5="false" 学年6="false"/>
</学部>
....
------
<SFC>
<faculty>
<name>総合政策学部</name>
</faculty>
...
<?xml version="1.0"?> <rdf:RDF xml:lang="ja" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:edu="http://example.org/education#"> <rdf:Description rdf:about="http://www.sfc.keio.ac.jp/"> <edu:hasFaculty>環境情報学部</edu:hasFaculty> </rdf:Description>
<?xml version="1.0"?> <rdf:RDF xml:lang="ja" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:edu="http://example.org/education#"> <rdf:Description rdf:about="http://www.sfc.keio.ac.jp/"> <edu:hasFaculty>環境情報学部</edu:hasFaculty> <edu:hasFaculty>総合政策学部</edu:hasFaculty> <edu:hasFaculty>看護医療学部</edu:hasFaculty> </rdf:Description>
<?xml version="1.0"?>
<rdf:RDF xml:lang="ja"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:edu="http://example.org/education#">
<rdf:Description rdf:about="http://www.sfc.keio.ac.jp/">
<edu:hasFaculty>
<rdf:Description rdf:about="http://www.sfc.keio.ac.jp/EnvironmentalInformation">
<edu:name>環境情報学部</edu:name>
<edu:dean>富田勝</edu:name>
</rdf:Description>
</edu:hasFaculty>
</rdf:Description>
<?xml version="1.0"?>
<rdf:RDF
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://purl.org/rss/1.0/"
xml:lang="ja">
<channel rdf:about="http://www.sfc.keio.ac.jp/">
<title>SFC 新着情報</title>
<link>http://www.sfc.keio.ac.jp</link>
<description> SFC サイトの最新ニュース</description>
<items>
<rdf:Seq>
<rdf:li rdf:resource="http://www.sfc.keio.ac.jp/faculty/news/articles/20040630_1054_4285.html"/>
</rdf:Seq>
</items>
<item rdf:about="http://www.sfc.keio.ac.jp/students_soukan/news/articles/20040630_1054_4285.html">
<title>2007年度教育奨励基金採用者発表</title>
<link>http://www.sfc.keio.ac.jp/students_soukan/news/articles/20040630_1054_4285.html</link>
<description />
<dc:date>2007-07-04T18:15:00+09:00</dc:date>
</item>
</channel>
</rdf:RDF>
<rdf:Description rdf:about="http://www.sfc.keio.ac.jp/"> <rdf:type rdf:resource="http://example.org/education#Campus" </rdf:Desciprion> <rdf:Description rdf:about="http://www.sfc.keio.ac.jp/EnvironmentalInformation"> <rdf:type rdf:resource="http://example.org/education#Faculty" </rdf:Desciprion> <rdfs:Property rdf:about="http://example.org/education#hasFaculty"> <rdf:domain rdf:resource="http://example.org/education#Campus" <rdf:range rdf:resource="http://example.org/education#Faculty" </rdf:Desciprion>
<owl:Class rdf:about="http://example.org/education#Faculty"> <owl:equivalentClass rdf:resource="http://school.org/school#Department"/> </owl:Class>
<owl:Class rdf:about="http://example.org/education#Faculty"> <owl:disjointWith rdf:resource="http://school.org/school#GraduateSchool"/> </owl:Class>
<owl:Class rdf:about="http://example.org/education#Campus">
<owl:subClassOf>
<owl:Resriction>
<owl:onProperty rdf:resource="http://example.org/education#hasFaculty"/>
<owl:minCardinality>1</owl:minCardinality>
</owl:Resriction>
<owl:subClassOf>
</owl:Class>
<owl:ObjectProperty rdf:about="http://example.org/education#hasFaculty"> <owl:equivalentProperty rdf:resource="http://school.org/school#hasDepartment"/> </owl:ObjectProperty>
<owl:InverseFunctionalProperty rdf:about="http://example.org/education#studentNumber"> <rdfs:domain rdf:resource="http://example.org/education#Student"/> </owl:FunctionalProperty>
PREFIX edu: <http://example.org/education#>
SELECT ?faculty
WHERE { <http://www.sfc.keio.ac.jp/> edu:Faculty ?faculty }
<?xml version="1.0"?>
<sparql xmlns="http://www.w3.org/2005/sparql-results#">
<head>
<variable name="faculty"/>
</head>
<results distinct="false" ordered="false">
<result>
<binding name="faculty"><uri>http://www.sfc.keio.ac.jp/EnvironmentalInformation</uri></binding>
</result>
<result>
<binding name="faculty"><uri>http://www.sfc.keio.ac.jp/PolicyManagement</uri></binding>
</result>
</results>
</sparql>
If an item is perishable and it is delivered to John more than 10 days after the scheduled delivery date then the item will be rejected by him.
Forall ?item ?deliverydate ?scheduledate ?diffdate
(
reject(John ?item) :-
And ( perishable(?item)
delivered(?item ?deliverydate John)
scheduled(?item ?scheduledate)
timediff(?diffdate ?deliverydate ?scheduledate)
greaterThan(?diffdate 10) )
)
----
<Ruleset>
<Forall>
<declare><Var>item</Var></declare>
<declare><Var>deliverydate</Var></declare>
<declare><Var>scheduledate</Var></declare>
<declare><Var>diffdate</Var></declare>
<formula>
<Implies>
<then>
<Uniterm>
<Const>reject</Const>
<Const>John</Const>
<Var>item</Var>
</Uniterm>
</then>
<if>
<And>
<Uniterm>
<Const>perishable</Const>
<Var>item</Var>
</Uniterm>
<Uniterm>
<Const>delivered</Const>
<Var>item</Var>
<Var>deliverydate</Var>
<Const>John</Const>
</Uniterm>
<Uniterm>
<Const>scheduled</Const>
<Var>item</Var>
<Var>scheduledate</Var>
</Uniterm>
<Uniterm>
<Const>timediff</Const>
<Var>diffdate</Var>
<Var>deliverydate</Var>
<Var>scheduledate</Var>
</Uniterm>
<Uniterm>
<Const>greaterThan</Const>
<Var>diffdate</Var>
<Const>10</Const>
</Uniterm>
</And>
</if>
</Implies>
</formula>
</Forall>
<Forall>
<declare><Var>item</Var></declare>
<formula>
<Implies>
<then>
<Uniterm>
<Const>reject</Const>
<Const>Fred</Const>
<Var>item</Var>
</Uniterm>
</then>
<if>
<Uniterm>
<Const>unsolicited</Const>
<Var>item</Var>
</Uniterm>
</if>
</Implies>
</formula>
</Forall>
</Ruleset>