Thanks Holger, LocationMapper works great. For the sake of
completeness, the approach I followed is as follows. First you need to
create a file that maps your locations. Mine is called location-
mappings.ttl:
@prefix lm: <http://jena.hpl.hp.com/2004/08/location-mapping#> .
[] lm:mapping
[ lm:name "http://sofia.gotdns.com/ontologies/
SemanticConnections.owl" ; lm:altName
"file:SemanticConnections.owl" ] ,
[ lm:name "http://sofia.gotdns.com/ontologies/
SemanticInteraction.owl" ; lm:altName
"file:SemanticInteraction.owl" ] .
Then you define it in your code before loading the ontology:
import com.hp.hpl.jena.util.LocationMapper;
LocationMapper lm= new LocationMapper("location-mapping.ttl");
LocationMapper.setGlobalLocationMapper(lm);
FileManager.get().setLocationMapper(lm);
If all goes well, it will load the local versions of specified
imported ontologies.
Regards,
Gerrit
On Jun 17, 12:13 am, Holger Knublauch <[email protected]> wrote:
> Yes you can use Jena to redirect imports. I haven't done this myself, but
> according to the source code, the classes LocationMapper and FileManager seem
> to be relevant. On details, please follow up on the Jena mailing list to meet
> the experts.
>
> Thanks
> Holger
>
> On Jun 16, 2011, at 9:16 PM, Gerrit wrote:
>
>
>
>
>
>
>
> > I finally figured out what the problem is. When using TBC, I am
> > working with local copies of two ontologies, where one imports the
> > other using owl:imports. When using the SPIN API, my domain ontology
> > (which I import from a local file) imports the other ontology from the
> > web, instead of from a local file. The web version did not contain the
> > same constraint violation as the local version, so it didn't show up.
>
> > This is probably more an OWL- or Jena-related question, but is there a
> > way to specify that an OWL import should first look for a local copy
> > before loading the web version? (e.g. the mechanism used in TBC)
>
> > On Jun 16, 6:46 am, Holger Knublauch <[email protected]> wrote:
> >> On Jun 16, 2011, at 9:33 AM, Holger Knublauch wrote:
>
> >>> On Jun 15, 2011, at 6:29 PM, Gerrit wrote:
> >>>> Now I do have a case of not all constraint violations showing up. I
> >>>> have defined a property chain as an irreflexive property, and when
> >>>> this is violated it shows up correctly in TBC. I don't see this
> >>>> violation when using SPIN API.
>
> >>> I double-checked that the SPIN API also honors spin:imports for
> >>> constraint checking (not for rules though). So I believe we need more
> >>> information on your set up to help.
>
> >> BTW, another difference between your model in the SPIN API and the model
> >> in TBC might be that TBC models always include the system triples, e.g.
> >> the definition of ranges and domains of system properties such as
> >> rdf:type. This might affect results in some cases. In order to include the
> >> system triples, there is a helper class SystemTriples in the SPIN API. If
> >> this rings a bell, try to create a MultiUnion with this as a sub graph and
> >> run constraint checks over that.
>
> >> Holger
>
> > --
> > You received this message because you are subscribed to the Google
> > Group "TopBraid Suite Users", the topics of which include TopBraid Composer,
> > TopBraid Live, TopBraid Ensemble, SPARQLMotion and SPIN.
> > 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-users?hl=en
--
You received this message because you are subscribed to the Google
Group "TopBraid Suite Users", the topics of which include TopBraid Composer,
TopBraid Live, TopBraid Ensemble, SPARQLMotion and SPIN.
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-users?hl=en