Skip to content
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

blank nodes cannot be viewed as subjects #77

Open
mathib opened this issue Apr 30, 2020 · 2 comments
Open

blank nodes cannot be viewed as subjects #77

mathib opened this issue Apr 30, 2020 · 2 comments

Comments

@mathib
Copy link

mathib commented Apr 30, 2020

Expected Behavior

Being able to view triples with a BN as the subject, either through the details view on the BN when in object position or when focusing on the BN directly.

Actual Behavior

I can see BNs appear in the facet browser list and when viewing individual resources as long as the BNs are in the object position of triples. If I want to view details of a BN object, I cannot see the triples with this BN as the subject. If I click on the blank node, I end up on an empty LD-R page of that BN (no triples are shown, only the BN ID is presented). I played a bit with the settings in reactor.js for the property pointing to BNs and set hasBlankNode: 1, but without success.

I did some tests with GraphDB and Stardog.

With GraphDB, I receive an error from GraphDB, that it received an erroneous SPARQL query (BN is treated as an absolute URI):

SELECT ?p ?o (count(DISTINCT ?extendedVal) AS ?hasExtendedValue) (SAMPLE(?olb) AS ?oLabel) (SAMPLE(?otb) AS ?oTitle) WHERE {
                    <genid-53084fa0d170462385c61b802e2a8c51-54A3A8A758360AD4000A05D1876753C6> ?p ?o .
                    OPTIONAL {?o ?uri ?extendedVal .}
                    OPTIONAL {?o rdfs:label ?ol .}
                    OPTIONAL {?o dcterms:title ?ot .}
                    BIND ( IF (BOUND (?ol), ?ol, '' )  as ?olb  ) .
                    BIND ( IF (BOUND (?ot), ?ot, '' )  as ?otb  ) .
            } GROUP BY ?p ?o

'MALFORMED QUERY: Not a valid (absolute) IRI: genid-0ec5327183c642a3aff8f0b3208583c7-130'

With Stardog, I only get an error from LD-R

TypeError: Cannot read property 'value' of undefined
    at C:\Users\username\Desktop\ld-r-mathib\services\utils\ResourceUtil.js:354:92
    at eachfn (C:\Users\username\Desktop\ld-r-mathib\node_modules\async\dist\async.js:2948:28)
    at replenish (C:\Users\username\Desktop\ld-r-mathib\node_modules\async\dist\async.js:440:21)
    at C:\Users\username\Desktop\ld-r-mathib\node_modules\async\dist\async.js:445:13
    at awaitify (C:\Users\username\Desktop\ld-r-mathib\node_modules\async\dist\async.js:2947:9)
    at awaitable (C:\Users\username\Desktop\ld-r-mathib\node_modules\async\dist\async.js:208:32)
    at Object.parallelLimit (C:\Users\username\Desktop\ld-r-mathib\node_modules\async\dist\async.js:3053:16)
    at C:\Users\username\Desktop\ld-r-mathib\services\utils\ResourceUtil.js:411:26
    at C:\Users\username\Desktop\ld-r-mathib\services\utils\Configurator.js:344:11
    at DynamicConfigurator.prepareDynamicPropertyConfig (C:\Users\username\Desktop\ld-r-mathib\plugins\dynamicConfiguration\DynamicConfigurator.js:655:9)
    at C:\Users\username\Desktop\ld-r-mathib\services\utils\Configurator.js:219:29
    at C:\Users\username\Desktop\ld-r-mathib\services\utils\Configurator.js:193:11
    at DynamicConfigurator.prepareDynamicResourceConfig (C:\Users\username\Desktop\ld-r-mathib\plugins\dynamicConfiguration\DynamicConfigurator.js:571:9)
    at C:\Users\username\Desktop\ld-r-mathib\services\utils\Configurator.js:124:29
    at C:\Users\username\Desktop\ld-r-mathib\services\utils\Configurator.js:99:9
    at DynamicConfigurator.prepareDynamicDatasetConfig (C:\Users\username\Desktop\ld-r-mathib\plugins\dynamicConfiguration\DynamicConfigurator.js:333:9)
    at Configurator.prepareDatasetConfig (C:\Users\username\Desktop\ld-r-mathib\services\utils\Configurator.js:83:27)
    at Configurator.prepareResourceConfig (C:\Users\username\Desktop\ld-r-mathib\services\utils\Configurator.js:118:12)
    at Configurator.preparePropertyConfig (C:\Users\username\Desktop\ld-r-mathib\services\utils\Configurator.js:212:12)
    at ResourceUtil.parseObjectProperties (C:\Users\username\Desktop\ld-r-mathib\services\utils\ResourceUtil.js:343:20)
    at C:\Users\username\Desktop\ld-r-mathib\services\resource.js:236:22
From previous event:
    at Request.RP$exposed [as then] (C:\Users\username\Desktop\ld-r-mathib\node_modules\request-promise-core\lib\plumbing.js:145:61)
    at C:\Users\username\Desktop\ld-r-mathib\services\resource.js:235:12
    at C:\Users\username\Desktop\ld-r-mathib\services\utils\dynamicHelpers.js:98:7
    at C:\Users\username\Desktop\ld-r-mathib\services\utils\dynamicHelpers.js:69:5
    at DynamicConfigurator.prepareDynamicServerConfig (C:\Users\username\Desktop\ld-r-mathib\plugins\dynamicConfiguration\DynamicConfigurator.js:122:9)
    at prepareDGFunc (C:\Users\username\Desktop\ld-r-mathib\services\utils\dynamicHelpers.js:32:23)
    at getDynamicEndpointParameters (C:\Users\username\Desktop\ld-r-mathib\services\utils\dynamicHelpers.js:79:5)
    at Object.read (C:\Users\username\Desktop\ld-r-mathib\services\resource.js:227:56)
    at Immediate.executeRequest (C:\Users\username\Desktop\ld-r-mathib\node_modules\fetchr\libs\fetcher.js:234:21)
    at runCallback (timers.js:706:11)
    at tryOnImmediate (timers.js:676:5)
    at processImmediate (timers.js:658:5)

Steps to Reproduce the Problem

  1. Set up a triplestore and load some blank nodes (incl. incoming and outgoing triples)
  2. Try to view the outgoing triples using either detail view (object position) or by focusing on the BN

Specifications

  • Version: LD-R v1.3.7
  • Platform: Windows 10
  • Subsystem: tested with triplestore GraphDB (v9.1.1) and Stardog (v7.2.0)
@mathib
Copy link
Author

mathib commented Apr 30, 2020

At least with GraphDB, I might have found a workaround but it's specific for GraphDB. It's possible to get the internal GraphDB ID of each URI, BN, literal, etc.: http://graphdb.ontotext.com/documentation/free/query-behaviour.html?highlight=blank%20node

With the following query, the ID can be retrieved of a BN:

PREFIX ent: <http://www.ontotext.com/owlim/entity#>
SELECT * WHERE {
       FILTER (isBlank(?bn))
	?bn ent:id ?id .
} ORDER BY ?id

And with this query, the ID (xsd:long, eg 5660) can be used to query information

PREFIX ent: <http://www.ontotext.com/owlim/entity#>
SELECT * WHERE {
	?s ent:id 5660 ; ?p ?o .
}

@mathib
Copy link
Author

mathib commented Apr 30, 2020

A more generic solution might be to find blank nodes by matching their projected string.

SELECT *
WHERE { 
    ?bn ?p ?o .
    BIND(STR(?bn) AS ?bnString)
    FILTER(?bnString = "genid-6aa0586592bf40cc83e34d1771ad8adf-0")
}

This works for Stardog, but sadly not for GraphDB... (empty strings are returned for ?bnString)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant