问题
In my graph I have the following assertions
@prefix : <http://www.example.org/~joe/contact.rdf#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
:joesmith a foaf:Person ;
foaf:givenname "Joe" ;
foaf:family_name "Smith" ;
foaf:homepage <http://www.example.org/~joe/> ;
foaf:mbox <mailto:joe.smith@example.org> .
I loaded the graph in GraphDB.
If I point the GraphDB's Visual Graph to :joesmith
, I would like to see all the triples but I see this graph
foaf:givenname
and foaf:family_name
are not shown in the graph but they are in node details tab, and it's ok.
Instead the node http://www.example.org/~joe/
is not connected to :joesmith
. It seems pretty wired, since there is an explicit assertion belonging to :joesmith
Is this a bug or a problem in my data?
回答1:
This is definitely a bug. This bug affects Visual Graph functionality only. In the SPARQL results view, everything is fine.
The problem seems to be complex. There are two factors:
This namespace —
<http://xmlns.com/foaf/0.1/>
— is hardcoded somewhere.This namespace is not proceeded correctly.
Let us consider the following examples.
Before each example, clear your repository and delete prefixes created in Setup > Namespaces.
Case 1
@prefix : <http://www.example.org/~joe/contact.rdf#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
:joesmith a foaf:Person ;
foaf:givenname "Joe" ;
foaf:family_name "Smith" ;
foaf:homepage <http://www.example.org/~joe/> ;
foaf:mbox <mailto:joe.smith@example.org> .
As you have pointed out, <http://www.example.org/~joe/>
is not shown.
Case 2
@prefix : <http://www.example.org/~joe/contact.rdf#> .
@prefix foo: <http://xmlns.com/foaf/0.1/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
:joesmith a foo:Person ;
foo:givenname "Joe" ;
foo:family_name "Smith" ;
foo:homepage <http://www.example.org/~joe/> ;
foo:mbox <mailto:joe.smith@example.org> .
In this case, <http://www.example.org/~joe/>
is not shown.
Case 3
@prefix : <http://www.example.org/~joe/contact.rdf#> .
@prefix foaf: <http://xmlns.com/foaf/01/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
:joesmith a foaf:Person ;
foaf:givenname "Joe" ;
foaf:family_name "Smith" ;
foaf:homepage <http://www.example.org/~joe/> ;
foaf:mbox <mailto:joe.smith@example.org> .
In this case, <http://www.example.org/~joe/>
is shown.
Case 4
@prefix : <http://www.example.org/~joe/contact.rdf#> .
@prefix foaf: <http://xmln.com/foaf/0.1/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
:joesmith a foaf:Person ;
foaf:givenname "Joe" ;
foaf:family_name "Smith" ;
foaf:homepage <http://www.example.org/~joe/> ;
foaf:mbox <mailto:joe.smith@example.org> .
In this case, <http://www.example.org/~joe/>
is shown.
I'll try to contact their support team directly by sending email.
UPDATE 1
They say there are four kinds of RDF terms:
- URIs
- Literals
- Blank nodes
- URIs considered by their team as "not real".
From GraphDB query logs, one can ascertain what URIs are of the fourth kind.
BIND (strstarts(str(?p), "http://purl.org/dc/terms/") ||
strstarts(str(?p), "http://dbpedia.org/ontology/subsidiary") AS ?isMeta)
FILTER(!strstarts(str(?p), "http://www.w3.org/2002/07/owl#")
&& !strstarts(str(?p), "http://www.w3.org/1999/02/22-rdf-syntax-ns#")
&& !strstarts(str(?p), "http://www.w3.org/2000/01/rdf-schema#")
&& !strstarts(str(?p), "http://www.openrdf.org/schema/sesame#")
&& !strstarts(str(?p), "http://www.ontologydesignpatterns.org/ont/dul/DUL.owl")
&& !strstarts(str(?p), "http://www.w3.org/ns/prov")
&& !strstarts(str(?p), "http://dbpedia.org/ontology/wikiPage")
&& !strstarts(str(?p), "http://dbpedia.org/property/wikiPage")
&& !strstarts(str(?p), "http://www.omg.org/spec/")
&& !strstarts(str(?p), "http://www.wikidata.org/entity/")
&& !strstarts(str(?p), "http://factforge.net/")
&& ?p != <http://dbpedia.org/property/logo>;
&& ?p != <http://dbpedia.org/property/hasPhotoCollection>;
&& ?p != <http://dbpedia.org/property/website>;
&& ?p != <http://dbpedia.org/property/homepage>;
&& ?p != <http://dbpedia.org/ontology/thumbnail>;
&& ?p != <http://xmlns.com/foaf/0.1/depiction>;
&& ?p != <http://xmlns.com/foaf/0.1/homepage>;
)
UPDATE 2
In GraphDB 8.3, it was fixed in some way:
GDB-2076 - Visual graph: consistent handling of foaf/dbpedia predicates that point to IRIs but are treated as literals
回答2:
The Visual graph functionality shows resources (= things that have IRIs) and how they are connected. Since foaf:givenname and foaf:family_name point to literals they aren't shown in the graph. You are right that foaf is handled specially. The properties foaf:homepage and foaf:depiction are treated as if they point to literals (and hence are not shown) because they are used to refer to URLs on the internet and not as real RDF IRIs pointing to other resources in the graph. No other foaf properties are treated specially.
In a future version of GraphDB you'll have a more fine grained control over what's omitted.
Edited: not showing foaf:homepage in the side panel (where literals are shown) is inconsistent with hiding it from the graph. This will be addressed in the next version.
回答3:
Since GraphDB 8.3 you configure all of the queries of the Visual Graph by creating your own Visual Graph Config. Check the documentation here. http://graphdb.ontotext.com/documentation/enterprise/devhub/custom-graph-views.html?highlight=visual%20graph%20config
There is also a webinar. https://www.ontotext.com/custom-graph-views-webinar-recording/
来源:https://stackoverflow.com/questions/45085969/graphdbs-visual-graph-does-not-display-all-triples