RDF to F-logic

Hi!
We developed a parser (based on SiRPAC) to parse the RDF to F-logic (a
DOOD prototype). Instead of standard triple model in SiRPAC, we
transform RDF to the following format: 
Subject[Predicate->Object].
Further, for containers like bag, seq and alt, we have the following: 
-----------------------------------------
*	RDF code
-----------------------------------------
<?xml version="1.0"?>
<rdf:RDF  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
          xmlns:s="http://purl.org/dc/elements/1.0/">
    <rdf:Description about="http://mycollege.edu/courses/6.001">
      <s:students>
        <rdf:Bag>
          <rdf:li resource="http://mycollege.edu/students/Amy"/>
          <rdf:li resource="http://mycollege.edu/students/Tim"/>
        </rdf:Bag>
      </s:students>
    </rdf:Description>
</rdf:RDF>  

------------------------------------------
*	SiRPAC translation
------------------------------------------
triple("http://www.w3.org/1999/02/22-rdf-syntax-ns#type","file:test2.rdf#genid2","http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag").
triple("http://www.w3.org/1999/02/22-rdf-syntax-ns#_1","file:test2.rdf#genid2","http://mycollege.edu/students/Amy").
triple("http://www.w3.org/1999/02/22-rdf-syntax-ns#_2","file:test2.rdf#genid2","http://mycollege.edu/students/Tim").
triple("http://purl.org/dc/elements/1.0/students","http://mycollege.edu/courses/6.001","file:test2.rdf#genid2").       

------------------------------------------
*	F-logic translation
------------------------------------------
"http://mycollege.edu/courses/6.001"["http://purl.org/dc/elements/1.0/students"->bag("http://mycollege.edu/courses/6.001",
"http://purl.org/dc/elements/1.0/students")].
bag("http://mycollege.edu/courses/6.001",
"http://purl.org/dc/elements/1.0/students"):bag_collection.
bag("http://mycollege.edu/courses/6.001",
"http://purl.org/dc/elements/1.0/students")[bag_value->cons("http://mycollege.edu/students/Tim",cons("http://mycollege.edu/students/Amy",nil))].                     

We can define the signatures of 'bag_collection' as:
bag_collection[hasElement@(string)=>int].

We can define the rules of bag_collection as:
X[hasElement(Y) -> C] :- X[bag_value->Z], count(Y,Z,C),
X:bag_collection.

if C =0 , means there is no such element in the bag
if C>=1 , means there is(are) such element in the bag, C is the number
of this element ( Duplicate values are permitted)

The schema part of RDF can be expressed in F-logic in a elegant way too,
like subClassOf ... (ongoing)

Any comments?

Fang

Received on Thursday, 29 July 1999 05:43:23 UTC