ld-r icon indicating copy to clipboard operation
ld-r copied to clipboard

Support property chains in reactor.js

Open Maysk opened this issue 6 years ago • 9 comments

Is it possible to put a chain property at reactor.js?

Example: 'uri1->uri2':{ label: ['A'] },

Maysk avatar Jul 25 '19 12:07 Maysk

yes, it is possible to do that in reactor.js ! The only caveat is that static reactor.js doesn't support cURIs which means instead of vocab1:p->vocab2:t you should use the complete URIs of intender properties.

ali1k avatar Jul 26 '19 07:07 ali1k

I tried to do it and didn't have success. It worked only in facet.js. (I use the complete uri in both examples.)

I am using the version labeled as vv1.3.6

PS: LD-R is fantastic. I have a wonderful surprise the first time I used it, because it's really easy to install. Congrats!

Maysk avatar Jul 26 '19 13:07 Maysk

thanks for your feedback. It would be great if you can share your configs at reactor.js so that I can regenerate the issue.

ali1k avatar Jul 27 '19 19:07 ali1k

To regenerate the issue, you can try the following at the example of dbpedia.

File reactor.js

'http://dbpedia.org/sparql': { list: [ 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type', 'http://dbpedia.org/ontology/country', 'http://dbpedia.org/property/established' ], config: { 'http://dbpedia.org/property/established': { label: ['Established Year'] }, 'http://dbpedia.org/ontology/country': { objectBrowser: ['TagListBrowser'] },

//Added Part 'http://dbpedia.org/ontology/location->http://xmlns.com/foaf/0.1/name':{ label: ['Location Name']
}

        }
    }

Maysk avatar Jul 29 '19 10:07 Maysk

This seems to be your facets.js file. And as I see there you haven't added that new property to the list yet. If you change your list to

list: [
'http://www.w3.org/1999/02/22-rdf-syntax-ns#type', 'http://dbpedia.org/ontology/country', 'http://dbpedia.org/property/established, 'http://dbpedia.org/ontology/location->http://xmlns.com/foaf/0.1/name'
],

I guess it should work.

ali1k avatar Jul 29 '19 10:07 ali1k

Actually, I sent the wrong part. I was from facet.js as you noticed. My appologies.

try to insert the following on reactor.js:

'http://dbpedia.org/ontology/location->http://xmlns.com/foaf/0.1/name':{
                label: ['Location Name']  
}

And try to acess "European Bank for Reconstruction and Development" in ldr.

Should it show the property "Location Name"?

Maysk avatar Jul 29 '19 10:07 Maysk

I still need to regenerate it using some sample data.

ali1k avatar Aug 01 '19 15:08 ali1k

You can recreate using the following: test.zip

Inside this zip file there are the config files needed to set up the test and the sparql used to insert the triples on the dataset. I am using virtuoso triplestore.

the config/reactor.js has this configuration: image

However, the property 'http://example.org/ns#relatedTo->http://example.org/ns#name' is not shown here: image

Maysk avatar Aug 02 '19 11:08 Maysk

Thanks for the file. I checked it. LD-R doesn't support property chains for properties in reactor.js. I think I didn't have a use case for that but would be a good new feature request!

ali1k avatar Aug 02 '19 20:08 ali1k