is it possible to have transitive rules
is it possible to have transitive rules for certain verbs if all verb are the same type but i distinguish on id? in the "then" part of my transitivity rule, it won't let me have:
(arg0: $x0, arg1: $x2) isa ul-verb, has id "IsA";
because i can't attach the id15 Replies
Could you post the whole rule to give some more context?
You can't (yet) attach an attribute when inferring a relation , but you could potentially add it as a role-player instead.
this is the rule I want to define, I need the output attribute =/
Just for clarity: Is this in your current schema or if you were to model individual verbs as entities/relations?
If it's in the approach where you're modelling verbs as instances rather than types, I'd suggest:
hmm, very clever... i'd need to remove the "has id" bit at the end of the 2nd last line of the "when", right?
Yes. I missed that
very clever!!
when i want to add a relation, can i do:
i've added id as
@key
on the verb; i only want one instance of a verb with a given id, right? will the insert here crash if the key is taken?Yes, it should.
how can i avoid this?
We plan to introduce 'optionals' in a coming release, which should solve this.
Till then, you can try a modelling hack: If
verb
owns id
as key, you could model the verb as the id
attribute itself instead of an entity which owns id
.
thanks - i'm just keeping a local cache of verbs i've added. i have another problem now 😦 all my (small set of) data inserts fine, but when I go to query, the iterator "next" call never comes back and it just hangs:
it prints "Got iter" but never returns
The iterator is lazy. It should only fetch the next result when you call next.
Is there reasoning involved in this query? Could you try running the same query through console?
(Also, should you be passing the format arguments for "{arg0_id}" and the others somewhere?
inference is turned on. i'm calling
next
but it never returns. i'm passing the ids in through the python function argsDo you not need to specify it after the
f'''<query>'''
?
I'd have expected a :
Either way, could you print out the query and try running it through console so we can isolate the problem to the server?it's a format string - the {syntax} pastes in the str of the named value
the ids are just strings
Hi, following on from yesterday, I did this query in TypeDB Studio and it never comes back:
Do you have inference turned on or off? (I'm guessing on, given that we discussed a rule)
Could you quickly confirm
1. if it runs fine with inference turned off.
2. How it performs when you don't specify
$t
? (i.e., comment out $t isa ul-entity, has id "Cheese";
)