You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Grant Pax <gr...@fwep.twostewards.com> on 2014/12/31 15:43:55 UTC

rdfcat and owl:imports/owl:Ontology

My ontological structure is developed in modules wired together with owl:imports triples. My production environment requires a single file. I have tried using rdfcat to flatten the system - without success so far. Multiple owl:Ontology triples are in the final file as one unresolved owl:imports triple. To get rid of the import triple, I have tried running the mostly-flattened file back through rdfcat but that didn’t do the trick. I have tried rdfparse thinking I could run it through sed - again without success ( error: (line 1 column 1): Content is not allowed in prolog.).  Any suggestions for producing a single file with only the top-level owl:Ontology intact and all owl:imports statements resolved (guess that’s a little redundant)? Protege’s merge functionality does it but I need to do it from the command line.

Thanks.

Re: rdfcat and owl:imports/owl:Ontology

Posted by Arthur Ryman <ry...@ca.ibm.com>.
Grant,

Just a suggestion... Use rdfcat to combine all the files into a single RDF 
file. Then execute a SPARQL Construct query to filter out the unwanted 
triples using arq.query [1]

e.g. this filters out the owl:import triples:

prefix owl: <http://www.w3.org/2002/07/owl#>
construct { ?s ?p ?o }
where {
   ?s ?p ?o
   filter (?p != owl:import)
}

Add suitable filters to eliminate the unwanted owl:Ontology triples.

[1] https://jena.apache.org/documentation/query/cmds.html

-- Arthur

Grant Pax <gr...@fwep.twostewards.com> wrote on 12/31/2014 09:43:55 AM:

> From: Grant Pax <gr...@fwep.twostewards.com>
> To: users@jena.apache.org
> Date: 12/31/2014 09:44 AM
> Subject: rdfcat and owl:imports/owl:Ontology
> 
> My ontological structure is developed in modules wired together with
> owl:imports triples. My production environment requires a single 
> file. I have tried using rdfcat to flatten the system - without 
> success so far. Multiple owl:Ontology triples are in the final file 
> as one unresolved owl:imports triple. To get rid of the import 
> triple, I have tried running the mostly-flattened file back through 
> rdfcat but that didn?t do the trick. I have tried rdfparse thinking 
> I could run it through sed - again without success ( error: (line 1 
> column 1): Content is not allowed in prolog.).  Any suggestions for 
> producing a single file with only the top-level owl:Ontology intact 
> and all owl:imports statements resolved (guess that?s a little 
> redundant)? Protege?s merge functionality does it but I need to do 
> it from the command line.
> 
> Thanks.


Re: rdfcat and owl:imports/owl:Ontology

Posted by Andy Seaborne <an...@apache.org>.
On 31/12/14 14:43, Grant Pax wrote:
> My ontological structure is developed in modules wired together with owl:imports triples. My production environment requires a single file. I have tried using rdfcat to flatten the system - without success so far. Multiple owl:Ontology triples are in the final file as one unresolved owl:imports triple. To get rid of the import triple, I have tried running the mostly-flattened file back through rdfcat but that didn’t do the trick. I have tried rdfparse thinking I could run it through sed - again without success ( error: (line 1 column 1): Content is not allowed in prolog.).  Any suggestions for producing a single file with only the top-level owl:Ontology intact and all owl:imports statements resolved (guess that’s a little redundant)? Protege’s merge functionality does it but I need to do it from the command line.
>
> Thanks.
>

"Content is not allowed in prolog" => the parse choice is RDF/XML when 
in fact the data is not.  Check the start of the file if you wanted 
RDF/XML, check how you call the program to parse if not.

	Andy