-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add an rule but no new tripples #11
Comments
Hello, Thanks ! |
const fs = require('fs')
const Hylar = require('hylar')
const h = new Hylar()
const file = fs.readFileSync('./kg.ttl', { encoding: 'utf-8' })
const PREFIX = IRI => `http://un.jong.kim/onto#${IRI}`
async function test() {
h.parseAndAddRule(`(?x http://un.jong.kim#hasChild ?y) ^ (?y http://un.jong.kim/onto#hasChild ?z) -> (?x http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://un.jong.kim/onto#GrandFather)`, 'R1')
const kg = await h.load(file, 'text/turtle')
const test = await squery(`select * where { ?s ?p :GrandFather . }`)
console.log(test)
}
test()
async function squery(q) {
return await h.query(`
PREFIX : <http://un.jong.kim/onto#>
${q}
`)
}
|
Looking at your data, it seems that you wrote Could you try with h.parseAndAddRule(`(?x http://un.jong.kim/onto#hasChild ?y) ^ (?y http://un.jong.kim/onto#hasChild ?z) -> (?x http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://un.jong.kim/onto#GrandFather)`, 'R1') please ? Thanks ! |
and it looks like h.parseAndAddRule should put before h.load |
This is right; currently, adding a rule does not reconsider the inferences. Ps: you can also simply state in your schema that hasFather is an owl:transitiveProperty, as HyLAR supports transitivity without adding any specific rule. |
The text was updated successfully, but these errors were encountered: