Well i've tried that before, it gaves me :
run:
f-0 (MAIN::initial-fact)
For a total of 1 facts in module MAIN.
f-0 (MAIN::initial-fact)
For a total of 1 facts in module MAIN.
BUILD SUCCESSFUL (total time: 1 second)
So it doesn't realy take the rules present on "ontologie-sein.clp" into
account.
In that file, I have list of rules that looks like this:
;;; Declaring the triple template ---------------------------------
(deftemplate triple "Template representing a triple"
(slot predicate (default ""))
(slot subject (default ""))
(slot object (default ""))
)
(open "testRel.txt" test "w")
(defrule rule-1
(triple
(predicate "http://www.w3.org/1999/02/22-rdf-syntax-ns#type")
(subject ?x1)
(object "http://www.owl-ontologies.com/mammonto.owl#Anomalie")
)
(triple
(predicate "http://www.owl-ontologies.com/mammonto.owl#contient_opacité")
(subject ?x1)
(object ?x2)
)
(triple
(predicate "http://www.w3.org/1999/02/22-rdf-syntax-ns#type")
(subject ?x3)
(object "http://www.owl-ontologies.com/mammonto.owl#Ronde")
)
(triple
(predicate "http://www.owl-ontologies.com/mammonto.owl#à_forme")
(subject ?x2)
(object ?x3)
)
=>
(assert
(triple
(predicate "http://www.w3.org/1999/02/22-rdf-syntax-ns#type")
(subject ?x1)
(object "http://www.owl-ontologies.com/mammonto.owl#ACR2")
)
)
)
When I tried to to put the following fact directly in the .clp file like this
:
(deffacts fact1
(triple
(predicate "http://www.w3.org/1999/02/22-rdf-syntax-ns#type")
(subject Anomalie1)
(object "http://www.owl-ontologies.com/mammonto.owl#Anomalie")
)
(triple
(predicate "http://www.owl-ontologies.com/mammonto.owl#contient_opacité")
(subject Anomalie1)
(object Opacité1)
)
(triple
(predicate "http://www.w3.org/1999/02/22-rdf-syntax-ns#type")
(subject Ovale1)
(object "http://www.owl-ontologies.com/mammonto.owl#Ovale")
)
(triple
(predicate "http://www.owl-ontologies.com/mammonto.owl#à_forme")
(subject Opacité1)
(object Ovale1)
)
so when I batch it and run it from java, it works properly, it gives me :
compile:
run:
f-0 (MAIN::initial-fact)
f-1 (MAIN::triple (predicate
"http://www.w3.org/1999/02/22-rdf-syntax-ns#type") (subject Anomalie1) (object
"http://www.owl-ontologies.com/mammonto.owl#Anomalie"))
f-2 (MAIN::triple (predicate
"http://www.owl-ontologies.com/mammonto.owl#contient_opacité") (subject
Anomalie1) (object Opacité1))
f-3 (MAIN::triple (predicate
"http://www.w3.org/1999/02/22-rdf-syntax-ns#type") (subject Ovale1) (object
"http://www.owl-ontologies.com/mammonto.owl#Ovale"))
f-4 (MAIN::triple (predicate
"http://www.owl-ontologies.com/mammonto.owl#à_forme") (subject Opacité1)
(object Ovale1))
For a total of 5 facts in module MAIN.
f-0 (MAIN::initial-fact)
f-1 (MAIN::triple (predicate
"http://www.w3.org/1999/02/22-rdf-syntax-ns#type") (subject Anomalie1) (object
"http://www.owl-ontologies.com/mammonto.owl#Anomalie"))
f-2 (MAIN::triple (predicate
"http://www.owl-ontologies.com/mammonto.owl#contient_opacité") (subject
Anomalie1) (object Opacité1))
f-3 (MAIN::triple (predicate
"http://www.w3.org/1999/02/22-rdf-syntax-ns#type") (subject Ovale1) (object
"http://www.owl-ontologies.com/mammonto.owl#Ovale"))
f-4 (MAIN::triple (predicate
"http://www.owl-ontologies.com/mammonto.owl#à_forme") (subject Opacité1)
(object Ovale1))
f-5 (MAIN::triple (predicate
"http://www.w3.org/1999/02/22-rdf-syntax-ns#type") (subject Anomalie1) (object
"http://www.owl-ontologies.com/mammonto.owl#ACR3"))
For a total of 6 facts in module MAIN.
BUILD SUCCESSFUL (total time: 1 second)
That's what i'd like to reach by adding facts from java.
in the string factstr, Instead of assert (triple...) i've tried to put also:
(deffacts fact1 (..........) ) like i've done in the .clp but it gaves me the
same above error. I dunno what's wrong !
Thanx a lot for ur help,
[EMAIL PROTECTED] wrote:
I think ahmad Sayed wrote:
>
> For a total of 1 facts in module MAIN.
> Jess reported an error in routine Funcall.execute
> while executing (triple (predicate
> "http://www.w3.org/1999/02/22-rdf-syntax-ns#type")
> ....................................etc...
OK, sorry, I didn't look closely at your code the first time. Let's
look at three lines of your Java code:
This first one creates an ordered fact of type "myfact1". Not sure
what this is for, but it doesn't hurt anything.
> Fact f = new Fact("myfact1", r);
This next one is where the error is occurring; the message "while
executing (triple..." is a hint that your facts are being interpreted
as function calls. That's because in the following line, you pass the
text of an "assert" function call to "assertString". assertString
wants the text of a single fact; you've instead sent it the text of a
function call that asserts two facts, and so it throws the exception.
> f=r.assertString(factstr);
If the previous line *had* succeeded, there would be no need to assert
"f" here, as the assertString call would have asserted it, so this
line would have no effect.
> r.assertFact(f);
Replace all three of these lines with
r.executeCommand(factstr);
and you should be in good shape.
---------------------------------------------------------
Ernest Friedman-Hill
Advanced Software Research Phone: (925) 294-2154
Sandia National Labs FAX: (925) 294-2234
PO Box 969, MS 9012 [EMAIL PROTECTED]
Livermore, CA 94550 http://herzberg.ca.sandia.gov
--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify [EMAIL PROTECTED]