Hi Joe,
this only happens with RDF/XML files. The reason why the system
creates apparently random j.0, j.1 etc namespaces is that they are
required for the XML syntax. For example, assume you have a property
<http://example.org/myProperty
> and a value 42, then the XML serialization would wrap this value
into an XML tag, and this XML tag must have a short name (qname). For
example, it could write
<j.0:myProperty>42</j.0:myProperty>
but it cannot write
<http://example.org/myProperty>42<http://example.org/myProperty>
The same happens if there is no defined prefix for a class, and then
instances are often serialized with the qname of the class.
Jena prevents such cases by automatically adding j.0 etc at save time.
To prevent this, either redeclare (keep duplicate) the prefix
declarations, or use a better serialization format such as Turtle/N3.
Regards,
Holger
On Nov 5, 2009, at 3:19 PM, Joseph Shea wrote:
>
> Hello Holger. I have tried to open the inferred file, deleted the
> prefixes and namespaces, and saved, but this did not change anything.
> The problem is that when I write new triples to that file, the
> namespaces seem to become associated with the j.X ones that comes over
> from the imported file. Other queries that reference the replaced
> namespace still seem to work (though i have not tested this
> thoroughly), but I was concerned over the random change of namespaces
> and was looking to see if there was a fix. It doesn't seem to cause
> problems at the moment, but I am hoping to get a fix in place to
> prevent a problem in the future.
>
> On Nov 5, 5:28 pm, Holger Knublauch <[email protected]> wrote:
>> Hi Joe,
>>
>> if you have unneeded prefix declarations in an import, then just
>> delete them from the imported file. Open the file separately and
>> delete the prefixes there. Then reload. Why does that not work, and
>> what is the problem if the namespaces are imported?
>>
>> Holger
>>
>> On Nov 5, 2009, at 1:56 PM, Joseph Shea wrote:
>>
>>
>>
>>> Hello all. After exporting an inference graph (just the inference
>>> graph and no files) and then import it into the main, I notice
>>> that it
>>> will bring in namespaces that match explicitly declared namespaces
>>> in
>>> the main file (though the imported ones are greyed out). This is
>>> causing a problem with prefixes throughout the file, and was
>>> wondering
>>> if there was an easy fix for it?
> >
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TopBraid Composer Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/topbraid-composer-users?hl=en
-~----------~----~----~----~------~----~------~--~---