Naming conflicts and human-readable labels mode

29 views
Skip to first unread message

Rich Keller

unread,
May 30, 2013, 7:42:16 PM5/30/13
to topbrai...@googlegroups.com
Hi: I'm a bit confused about the tree presentation in the Classes view and how ambiguous labels are handled. 

The help text says:

"In the "human-readable" labels mode, the system will try to display resources by their rdfs:labels (or sub-properties of rdfs:label). If no such labels are found, or if there is a name conflict between multiple resources with the same label, then the system will fall back to displaying qnames as above."

I have a class defined where the name is 'atm:XYZ' and the label is 'XYZ'.  To my knowledge, there are no other resources with the label 'XYZ', yet the classes view (toggled for human-readable mode) shows: XYZ [atm:XYZ].

Can you explain why the system thinks there is ambiguity?

Rich

Scott Henninger

unread,
May 30, 2013, 8:24:52 PM5/30/13
to topbrai...@googlegroups.com
Rich, you might try the following query to find out if there is  conflicting label:

SELECT *
WHERE
{  ?s ?p "XYZ"
}

If you get more than one result, there is a label conflict.
 

-- Scott

--
-- You received this message because you are subscribed to the Google
Group "TopBraid Suite Users", the topics of which include Enterprise Vocabulary Network (EVN), TopBraid Composer, TopBraid Live,
TopBraid Ensemble, SPARQLMotion, SPARQL Web Pages and SPIN.
To post to this group, send email to
topbrai...@googlegroups.com
To unsubscribe from this group, send email to
topbraid-user...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/topbraid-users?hl=en
---
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.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Message has been deleted

Holger Knublauch

unread,
Jun 2, 2013, 6:45:20 PM6/2/13
to topbrai...@googlegroups.com
Hi Rich,

sorry but I cannot reproduce this. I tried it by adding a class as shown below and (even with two rdf:types) it does render correctly.



Could you send us a small RDF file to help us reproduce this? Also which version of TBC do you use?

Thanks
Holger


On 6/1/2013 4:37, Rich Keller wrote:
Scott: I get only one result.

Try it yourself with a random one-word string (I tried QRTWXYQ, which displays as 'QRTWXYQ [atm:QRTWXYQ]' in the class view). It doesn't seem to be a problem for a two-word label (such as QrtwxyqQrtwxyq, which displays as 'Qrtwxyq Qrtwxyq' in the class view).

A bug, I suspect.
Message has been deleted

Rich Keller

unread,
Jun 3, 2013, 6:36:38 PM6/3/13
to topbrai...@googlegroups.com


Well, the problem seems to have something to do with prefix declarations.  When I deleted the atm: prefix declaration and recreated it, the problem disappeared.

Perhaps I am confused about how to handle prefixes.  In this particular ontology, I made the default namespace identical to the namespace associated with the atm: namespace. So there are two prefixes associated with the same namespace.

@prefix :        <http://xyz.arc.nasa.gov/ontology/ATM#> .
@prefix atm:     <http://xyz.arc.nasa.gov/ontology/ATM#> .

Is this not recommended practice?  I wanted to define classes using the explicit atm: prefix rather than relying on the default namespace as I thought this was the preferred practice. In addition, this file is being imported by other ontology files.

Rich

Scott Henninger

unread,
Jun 3, 2013, 6:46:07 PM6/3/13
to topbrai...@googlegroups.com, Rich Keller
Rich; The way prefixes work is that they are a simple text substitution.  So given you definitions, then;
  :fiddlestyx

... and
  atm:
fiddlestyx

...are precisely the same uri: <
http://xyz.arc.nasa.gov/ontology/ATM#fiddlestyx>I.e., you can use either prefix to produce the URI.

That's not something I would recommend, particularly using the default prefix.  Let's say you imported this file (graph) into another file (graph) that also defines the default prefix (i.e. your first @prefix statement).  Which should will be used?  In Composer, a new prefix will be created to resolve the ambiguity. 

That could cause some confusion, we'd suggest you only use the default prefix to create PowerPoint slides.

It seems, though that the real question is about labels, which is the rdfs:label property and its subproperties.  So the original issue could be different than this.  As Holger states, any example you can provide will be helpful.

-- Scott

Rich Keller

unread,
Jun 4, 2013, 12:03:26 PM6/4/13
to topbrai...@googlegroups.com, Rich Keller
Scott: Although the question is about labels, that issue is bound up with prefixes, it seems, at least in my case. I've attached a problematic ontology file that exhibits the problem (for me, at least).

Regarding prefixes, when I specify a Base URI for the ontology, TBC generates a corresponding default namespace automatically:
@prefix :        <http://xyz.arc.nasa.gov/ontology/ATM#>
In order to explicitly define and use a prefix, I must manually add one:
 
@prefix atm:        <http://xyz.arc.nasa.gov/ontology/ATM#>

So yes, I would not suggest using the default prefix, but TBC generates it, nonetheless. I suppose I could set the default namespace to blank and that would eliminate the default prefix.

Thanks for your help on this,
Rich

P.S. In full disclosure, on startup I get a TBC warning that I have been ignoring, though perhaps it is relevant to this issue:

java.io.FileNotFoundException: /Users/rmkelle1/Applications/tbc/TopBraid Composer.ini.orig (No such file or directory)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(FileInputStream.java:120)
    at java.io.FileInputStream.<init>(FileInputStream.java:79)
    at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:70)
    at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:161)
    at org.topbraidcomposer.core.CorePlugin.getIniContents(CorePlugin.java:450)
    at org.topbraidcomposer.core.CorePlugin.registerP2Listener(CorePlugin.java:404)
    at org.topbraidcomposer.core.CorePlugin.start(CorePlugin.java:392)
    at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
    at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)
    at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
    at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:299)
    at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:440)
    at org.eclipse.osgi.internal.loader.BundleLoader.setLazyTrigger(BundleLoader.java:268)
    at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:107)
    at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:462)
    at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216)
    at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:400)
    at org.eclipse.osgi.internal.loader.SingleSourcePackage.loadClass(SingleSourcePackage.java:35)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:473)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
    at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Class.java:2398)
    at java.lang.Class.getConstructor0(Class.java:2708)
    at java.lang.Class.newInstance0(Class.java:328)
    at java.lang.Class.newInstance(Class.java:310)
    at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:184)
    at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:905)
    at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
    at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55)
    at org.topbraid.core.TBPlugin.findPersonality(TBPlugin.java:316)
    at org.topbraid.core.TBPlugin.access$0(TBPlugin.java:299)
    at org.topbraid.core.TBPlugin$PersonalityHolder.<clinit>(TBPlugin.java:342)
    at org.topbraid.core.TBPlugin.getPersonality(TBPlugin.java:338)
    at org.topbraid.core.TBPlugin.start(TBPlugin.java:159)
    at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
    at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)
    at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
    at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:299)
    at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:440)
    at org.eclipse.osgi.internal.loader.BundleLoader.setLazyTrigger(BundleLoader.java:268)
    at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:107)
    at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:462)
    at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216)
    at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:400)
    at org.eclipse.osgi.internal.loader.SingleSourcePackage.loadClass(SingleSourcePackage.java:35)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:473)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
    at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    at org.topbraidcomposer.application.SplashHandler.init(SplashHandler.java:34)
    at org.eclipse.ui.internal.Workbench$8.run(Workbench.java:785)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.ui.internal.Workbench.createSplashWrapper(Workbench.java:801)
    at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2523)
    at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
    at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1410)


ATM.ttl

Scott Henninger

unread,
Jun 4, 2013, 3:14:25 PM6/4/13
to topbrai...@googlegroups.com
Rich; Try deleting the duplicated Default Namespace, or you can delete the "atm:" prefix.  Either way, the label problem should go away.

When creating a new vocabulary, I'd suggest you uncheck the "Set a default namespace in the new file", then a default namespace will not be created.  Instead a prefixed namespace will be created, which you can modify as needed.

-- Scott

Rich Keller

unread,
Jun 5, 2013, 1:20:28 PM6/5/13
to topbrai...@googlegroups.com
Thanks Scott. I wasn't aware of the checkbox. Rich
Reply all
Reply to author
Forward
0 new messages