Help with EDG Prefixes!

24 views
Skip to first unread message

Tim Smith

unread,
Jul 7, 2022, 3:31:03 PMJul 7
to TopBraid Suite Users
A few weeks ago, as I shared here, I exported all graphs and imported them into a fresh EDG Studio install to fix a Lucene indexing issue.  This caused every prefix in EDG to be assigned to every graph.  (Thanks jena!)  (EDG 7.2, I know this has been addressed in 7.3)

I am still trying to recover from this disaster.  I have been slowly going through each graph, changing the prefixes to the the correct set.  I have also ensured the EDG-wide defaults are correct.

However, even when creating a new Data Graph, importing an N-Triples file  (no prefixes!), ensuring that only the correct prefixes are in Settings, I am still seeing the incorrect prefixes on forms, in the source code panel, in the SPARQL panel, etc...

Looking at the Source Code and SPARQL panels and expanding the prefix twisty, I see the 200+ prefixes listed.  How do I force the prefixes listed there to reflect the EDG and graph defaults?  Are the prefixes used by these panels stored somewhere?

Thanks in advance for your help.  This is getting super annoying.  I'm getting questions from others as to why there are "crazy" prefixes showing up.

Tim

Holger Knublauch

unread,
Jul 7, 2022, 3:52:49 PMJul 7
to topbrai...@googlegroups.com

On 7 Jul 2022, at 3:31 pm, Tim Smith <smith...@gmail.com> wrote:

A few weeks ago, as I shared here, I exported all graphs and imported them into a fresh EDG Studio install to fix a Lucene indexing issue.  This caused every prefix in EDG to be assigned to every graph.  (Thanks jena!)  (EDG 7.2, I know this has been addressed in 7.3)

I am still trying to recover from this disaster.  I have been slowly going through each graph, changing the prefixes to the the correct set. 

I assume this was done through the Settings > Namespaces and Prefixes feature (which is the right place)?

I have also ensured the EDG-wide defaults are correct.

However, even when creating a new Data Graph, importing an N-Triples file  (no prefixes!), ensuring that only the correct prefixes are in Settings, I am still seeing the incorrect prefixes on forms, in the source code panel, in the SPARQL panel, etc...

Looking at the Source Code and SPARQL panels and expanding the prefix twisty, I see the 200+ prefixes listed.  How do I force the prefixes listed there to reflect the EDG and graph defaults?  Are the prefixes used by these panels stored somewhere?

I have just created an empty DataGraph and it produces and shows only those prefixes:


Could it be that your data graph owl:imports a file or Ontology that defines all the other prefixes? The various panels will use the union of all prefixes from all subgraphs. Also, do the prefixes already exist before you import the N-Triples file?


Thanks in advance for your help.  This is getting super annoying.  I'm getting questions from others as to why there are "crazy" prefixes showing up.

I can sympathise with your frustration, mate.

Holger



Tim

--
You received this message because you are subscribed to the Google Groups "TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to topbraid-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/1266198e-bf8d-4343-aa2b-cd1925839952n%40googlegroups.com.

Tim Smith

unread,
Jul 7, 2022, 7:02:43 PMJul 7
to TopBraid Suite Users
Hi Holger,

Thanks for the help.  I am correcting the prefixes via the Settings tab as you mentioned.

I had considered the impact of imports, so I went to the top of the import hierarchy which is a file that imports nothing but Default Constraints for EDG and the GraphQL vocabulary (system includes).  This graph is one that went through the trig export/import and shows all 200+ prefixes in the SPARQL window.  In the settings tab, I only see the prefixes you mentioned above, which is what I set them to earlier today.  Note that this graph only contains 5 triples.  The turtle export of the file is pasted below.

As an additional test, I created a new ontology with no imports.  The prefixes were the EDG defaults as expected.

For more fun, I imported the turtle file from above into the new ontology and, as expected, the prefixes were not modified.

I am at a loss as to how the graph coming from the trig import is picking up the prefixes if they aren't in an imported graph and they aren't in the Settings tab.

I'll keep poking around,

Tim

# baseURI: http://ontologies.pg.com/pgontology
# imports: http://datashapes.org/graphql

@base          <http://ontologies.pg.com/pgontology> .
@prefix metadata: <http://topbraid.org/metadata#> .
@prefix teamwork: <http://topbraid.org/teamwork#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .

<>      owl:versionInfo  "Created with TopBraid Composer" ;
        metadata:status  metadata:UnderDevelopmentStatus ;
        owl:imports      <http://datashapes.org/graphql> ;
        rdf:type         owl:Ontology ;
        rdfs:label       "SCHEMA_PGOntology-v1.0" .

Holger Knublauch

unread,
Jul 7, 2022, 7:16:38 PMJul 7
to topbrai...@googlegroups.com
There were two prefix-related problems in the past. One was that TDB was sharing all prefixes between all graphs but I believe this was a short-lasting glitch that we were able to work around quickly. The other remains that TriG files only store the prefixes in a single place. So if you’re importing TriG then all resulting graphs will get the union of all prefixes. We have worked around this by (recently) introducing the ability to export and import .zip files where each individual file is a Turtle file with its own prefixes.

All I can suggest is to walk through each owl:imported graph and their imports and check that they all only contain the minimum of prefixes. There has to be “leak” somewhere, i.e. an old file that got accidentally populated with the many prefixes, e.g. through TriG

Holger


Tim Smith

unread,
Jul 8, 2022, 1:08:07 AMJul 8
to topbrai...@googlegroups.com
Hi Holger,

The file I referred to in the previous posting only imported EDG system graphs so I'm confident it would not have imported additional prefixes unless the export as Trig/import as Trig process somehow assigned/exposed this graph to the complete set of prefixes.  

Any idea as to how I can stop this from happening?  If I pull my 7.2 workspace into 7.3 and export as a zip then import into an empty 7.3 workspace, might that remove all of the extraneous prefixes?

I don't know what else I can try as I have no way of debugging how the SPARQL panel is creating the list of prefixes in 7.2 and how that relates to an exported/imported Trig graph.  

Tim
 

David Price

unread,
Jul 8, 2022, 3:33:42 AMJul 8
to topbrai...@googlegroups.com
The zip option on the Exports tab is much better wrt prefixes and can handle a collection and its includes all at once.

Cheers,
David

Tim Smith

unread,
Aug 8, 2022, 4:32:51 PMAug 8
to TopBraid Suite Users
To close the loop on this... I have started using the zip export option which is, as mentioned, much better at prefix management.

The issue I was facing was that even though I had manually edited all of the imports accessible through EDG to remove the massive prefix list (nearly 300!), I was still getting errant prefixes on the forms and in SPARQL, etc... Holger mentioned that the panels use the union of all prefixes from all imports so I continued digging.

What I had not paid attention to before is that there are imports shown on the Settings tab that are not "clickable".  It turns out that these are files in the workspace but not managed by EDG.  So I went looking for them.  While I recognized some of the graph names as files I had created using TBC, I could not find any such file on disk with a similar name (they should be similar since I created them).  

I finally came across the edg/workspace/Imports directory which contains a set of .ttl files named graph<#>.ttl.  These files are my import graphs that I could not edit in EDG ( I can edit them via the File asset collection now that I know what and where they are).  Apparently they are created when using the Trig or Zip import functionality and the base URI does not conform to EDG's specification.  I edited each file in Notepad++ to remove the extra prefixes and restarted EDG.  Prefix problem solved!

My learning is to use the zip export capability and to pay attention to what is in the workspace/Imports directory!

Reply all
Reply to author
Forward
0 new messages