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! On Friday, July 8, 2022 at 3:33:42 AM UTC-4 David Price wrote: > 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 > > On 8 Jul 2022, at 06:08, Tim Smith <[email protected]> wrote: > > > 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 > > > On Thu, Jul 7, 2022 at 7:16 PM Holger Knublauch <[email protected]> > wrote: > >> 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 >> >> >> On 7 Jul 2022, at 7:02 pm, Tim Smith <[email protected]> wrote: >> >> 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" . >> >> On Thursday, July 7, 2022 at 3:52:49 PM UTC-4 Holger Knublauch wrote: >> >>> >>> On 7 Jul 2022, at 3:31 pm, Tim Smith <[email protected]> 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: >>> >>> PREFIX dash: <http://datashapes.org/dash#> >>> PREFIX dc: <http://purl.org/dc/elements/1.1/> >>> PREFIX dct: <http://purl.org/dc/terms/> >>> PREFIX edg: <http://edg.topbraid.solutions/model/> >>> PREFIX graphql: <http://datashapes.org/graphql#> >>> PREFIX metadata: <http://topbraid.org/metadata#> >>> PREFIX owl: <http://www.w3.org/2002/07/owl#> >>> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> >>> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> >>> PREFIX sh: <http://www.w3.org/ns/shacl#> >>> PREFIX skos: <http://www.w3.org/2004/02/skos/core#> >>> PREFIX skosxl: <http://www.w3.org/2008/05/skos-xl#> >>> PREFIX teamwork: <http://topbraid.org/teamwork#> >>> PREFIX test_data_graph: <http://example.org/data-graphs/Test_Data_Graph# >>> > >>> PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> >>> >>> 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 [email protected]. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/topbraid-users/1266198e-bf8d-4343-aa2b-cd1925839952n%40googlegroups.com >>> >>> <https://groups.google.com/d/msgid/topbraid-users/1266198e-bf8d-4343-aa2b-cd1925839952n%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> >>> >>> >> -- >> 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 [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/topbraid-users/2f801b6d-9a5d-4eb8-be6d-1a91bc581074n%40googlegroups.com >> >> <https://groups.google.com/d/msgid/topbraid-users/2f801b6d-9a5d-4eb8-be6d-1a91bc581074n%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> >> >> -- >> 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 [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/topbraid-users/26CB7E07-5EDF-4C1A-847F-3F7736A9265F%40topquadrant.com >> >> <https://groups.google.com/d/msgid/topbraid-users/26CB7E07-5EDF-4C1A-847F-3F7736A9265F%40topquadrant.com?utm_medium=email&utm_source=footer> >> . >> > -- > 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 [email protected]. > > To view this discussion on the web visit > https://groups.google.com/d/msgid/topbraid-users/CAF0WbnK8MtqR_V4J0aRhrHfVsNOofpUvtdMMME6DJxgvZuO1SA%40mail.gmail.com > > <https://groups.google.com/d/msgid/topbraid-users/CAF0WbnK8MtqR_V4J0aRhrHfVsNOofpUvtdMMME6DJxgvZuO1SA%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > > -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/6eb60d8c-3725-400e-a673-9afcdba0ad08n%40googlegroups.com.
