You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Eman Hossny <e....@fci-cu.edu.eg> on 2015/04/09 18:05:24 UTC

com.hp.hpl.jena.shared.BadURIException: Code: 0/ILLEGAL_CHARACTER in FRAGMENT

Hello All,
  I'm trying to use Jena API to insert individuals to my ontology with
names like the following:
com.microsoft.azure.storage.blob.CloudBlobClient.getContainerReference[java.lang.String]
however, when I trying to save my new ontolog--> it gives me the following
exception (could you help me in this issue):
Exception in thread "main" com.hp.hpl.jena.shared.BadURIException: Only
well-formed absolute URIrefs can be included in RDF/XML output: <
http://www.cs.uwm.edu/~alnusair/ontologies/scro.owl#com.microsoft.azure.storage.blob.CloudBlobClient.getContainerReference[java.lang.String]>
Code: 0/ILLEGAL_CHARACTER in FRAGMENT: The character violates the grammar
rules for URIs/IRIs.
at
com.hp.hpl.jena.rdfxml.xmloutput.impl.BaseXMLWriter.checkURI(BaseXMLWriter.java:835)
at
com.hp.hpl.jena.rdfxml.xmloutput.impl.BaseXMLWriter.relativize(BaseXMLWriter.java:812)
at
com.hp.hpl.jena.rdfxml.xmloutput.impl.Basic.writeResourceReference(Basic.java:156)
at
com.hp.hpl.jena.rdfxml.xmloutput.impl.Basic.writePredicate(Basic.java:109)
at
com.hp.hpl.jena.rdfxml.xmloutput.impl.Basic.writeRDFStatements(Basic.java:85)
at
com.hp.hpl.jena.rdfxml.xmloutput.impl.Basic.writeRDFStatements(Basic.java:74)
at com.hp.hpl.jena.rdfxml.xmloutput.impl.Basic.writeBody(Basic.java:48)
at
com.hp.hpl.jena.rdfxml.xmloutput.impl.BaseXMLWriter.writeXMLBody(BaseXMLWriter.java:502)
at
com.hp.hpl.jena.rdfxml.xmloutput.impl.BaseXMLWriter.write(BaseXMLWriter.java:474)
at com.hp.hpl.jena.rdf.model.impl.ModelCom.write(ModelCom.java:317)
at com.hp.hpl.jena.ontology.impl.OntModelImpl.write(OntModelImpl.java:2631)
at
fci.cu.paas.provider.semantic.model.PaaSCloudProviderSemanticModel.saveOntoModel(PaaSCloudProviderSemanticModel.java:88)
at
fci.cu.paas.parser.based.on.reflection.SourceCode2Ontology.main(SourceCode2Ontology.java:33)

I tried to insert my indiviuals manually using protege and it works with no
problem.
so, could you help me in inserting them using jena

-- 
Eman Hossny,
Teacher Assistant,
Computer Science Department,
Faculty of Computers and Information
Cairo University, Egypt

-- 


Re: com.hp.hpl.jena.shared.BadURIException: Code: 0/ILLEGAL_CHARACTER in FRAGMENT

Posted by Eman Hossny <e....@fci-cu.edu.eg>.
ok many thanks for ur help

On Fri, Apr 10, 2015 at 9:11 AM, Andy Seaborne <an...@apache.org> wrote:

> Use %5B and %5D (which are [ and ] encoded)
>
>         Andy
>
>
> On 10/04/15 01:00, Eman Hossny wrote:
>
>> many thanks for ur reply.
>> but I need to represent my source code as ontology--> so how I can
>> represent multiple individuals with the same name, where I have multiple
>> overloaded methods which have the same name and they differ in the
>> parameters.
>> in the current state I used [] to pass parameters to methods--> by this
>> way
>> I can create multiple individuals with the same name and different
>> parameters. however, using [] is not legal. Although, I have created
>> individuals in protege with names containing [] and it works with no
>> problem.
>>
>> could you plz help me in this issue?
>>
>> On Thu, Apr 9, 2015 at 6:43 PM, Andy Seaborne <an...@apache.org> wrote:
>>
>>  "[" and "]" aren't legal in URIs at that point.
>>>
>>> They are only legal for IPv6 addresses in the host part.
>>>
>>>          Andy
>>>
>>>
>>> On 09/04/15 17:05, Eman Hossny wrote:
>>>
>>>  Hello All,
>>>>     I'm trying to use Jena API to insert individuals to my ontology with
>>>> names like the following:
>>>> com.microsoft.azure.storage.blob.CloudBlobClient.
>>>> getContainerReference[java.lang.String]
>>>> however, when I trying to save my new ontolog--> it gives me the
>>>> following
>>>> exception (could you help me in this issue):
>>>> Exception in thread "main" com.hp.hpl.jena.shared.BadURIException: Only
>>>> well-formed absolute URIrefs can be included in RDF/XML output: <
>>>> http://www.cs.uwm.edu/~alnusair/ontologies/scro.owl#
>>>> com.microsoft.azure.storage.blob.CloudBlobClient.
>>>> getContainerReference[java.lang.String]>
>>>> Code: 0/ILLEGAL_CHARACTER in FRAGMENT: The character violates the
>>>> grammar
>>>> rules for URIs/IRIs.
>>>> at
>>>> com.hp.hpl.jena.rdfxml.xmloutput.impl.BaseXMLWriter.
>>>> checkURI(BaseXMLWriter.java:835)
>>>> at
>>>> com.hp.hpl.jena.rdfxml.xmloutput.impl.BaseXMLWriter.
>>>> relativize(BaseXMLWriter.java:812)
>>>> at
>>>> com.hp.hpl.jena.rdfxml.xmloutput.impl.Basic.
>>>> writeResourceReference(Basic.
>>>> java:156)
>>>> at
>>>> com.hp.hpl.jena.rdfxml.xmloutput.impl.Basic.
>>>> writePredicate(Basic.java:109)
>>>> at
>>>> com.hp.hpl.jena.rdfxml.xmloutput.impl.Basic.
>>>> writeRDFStatements(Basic.java:85)
>>>> at
>>>> com.hp.hpl.jena.rdfxml.xmloutput.impl.Basic.
>>>> writeRDFStatements(Basic.java:74)
>>>> at com.hp.hpl.jena.rdfxml.xmloutput.impl.Basic.writeBody(Basic.java:48)
>>>> at
>>>> com.hp.hpl.jena.rdfxml.xmloutput.impl.BaseXMLWriter.
>>>> writeXMLBody(BaseXMLWriter.java:502)
>>>> at
>>>> com.hp.hpl.jena.rdfxml.xmloutput.impl.BaseXMLWriter.
>>>> write(BaseXMLWriter.java:474)
>>>> at com.hp.hpl.jena.rdf.model.impl.ModelCom.write(ModelCom.java:317)
>>>> at com.hp.hpl.jena.ontology.impl.OntModelImpl.write(
>>>> OntModelImpl.java:2631)
>>>> at
>>>> fci.cu.paas.provider.semantic.model.PaaSCloudProviderSemanticModel
>>>> .saveOntoModel(PaaSCloudProviderSemanticModel.java:88)
>>>> at
>>>> fci.cu.paas.parser.based.on.reflection.SourceCode2Ontology.main(
>>>> SourceCode2Ontology.java:33)
>>>>
>>>> I tried to insert my indiviuals manually using protege and it works with
>>>> no
>>>> problem.
>>>> so, could you help me in inserting them using jena
>>>>
>>>>
>>>>
>>>
>>
>>
>


-- 
Eman Hossny,
Teacher Assistant,
Computer Science Department,
Faculty of Computers and Information
Cairo University, Egypt

-- 


Re: com.hp.hpl.jena.shared.BadURIException: Code: 0/ILLEGAL_CHARACTER in FRAGMENT

Posted by Andy Seaborne <an...@apache.org>.
Use %5B and %5D (which are [ and ] encoded)

	Andy

On 10/04/15 01:00, Eman Hossny wrote:
> many thanks for ur reply.
> but I need to represent my source code as ontology--> so how I can
> represent multiple individuals with the same name, where I have multiple
> overloaded methods which have the same name and they differ in the
> parameters.
> in the current state I used [] to pass parameters to methods--> by this way
> I can create multiple individuals with the same name and different
> parameters. however, using [] is not legal. Although, I have created
> individuals in protege with names containing [] and it works with no
> problem.
>
> could you plz help me in this issue?
>
> On Thu, Apr 9, 2015 at 6:43 PM, Andy Seaborne <an...@apache.org> wrote:
>
>> "[" and "]" aren't legal in URIs at that point.
>>
>> They are only legal for IPv6 addresses in the host part.
>>
>>          Andy
>>
>>
>> On 09/04/15 17:05, Eman Hossny wrote:
>>
>>> Hello All,
>>>     I'm trying to use Jena API to insert individuals to my ontology with
>>> names like the following:
>>> com.microsoft.azure.storage.blob.CloudBlobClient.
>>> getContainerReference[java.lang.String]
>>> however, when I trying to save my new ontolog--> it gives me the following
>>> exception (could you help me in this issue):
>>> Exception in thread "main" com.hp.hpl.jena.shared.BadURIException: Only
>>> well-formed absolute URIrefs can be included in RDF/XML output: <
>>> http://www.cs.uwm.edu/~alnusair/ontologies/scro.owl#
>>> com.microsoft.azure.storage.blob.CloudBlobClient.
>>> getContainerReference[java.lang.String]>
>>> Code: 0/ILLEGAL_CHARACTER in FRAGMENT: The character violates the grammar
>>> rules for URIs/IRIs.
>>> at
>>> com.hp.hpl.jena.rdfxml.xmloutput.impl.BaseXMLWriter.
>>> checkURI(BaseXMLWriter.java:835)
>>> at
>>> com.hp.hpl.jena.rdfxml.xmloutput.impl.BaseXMLWriter.
>>> relativize(BaseXMLWriter.java:812)
>>> at
>>> com.hp.hpl.jena.rdfxml.xmloutput.impl.Basic.writeResourceReference(Basic.
>>> java:156)
>>> at
>>> com.hp.hpl.jena.rdfxml.xmloutput.impl.Basic.
>>> writePredicate(Basic.java:109)
>>> at
>>> com.hp.hpl.jena.rdfxml.xmloutput.impl.Basic.
>>> writeRDFStatements(Basic.java:85)
>>> at
>>> com.hp.hpl.jena.rdfxml.xmloutput.impl.Basic.
>>> writeRDFStatements(Basic.java:74)
>>> at com.hp.hpl.jena.rdfxml.xmloutput.impl.Basic.writeBody(Basic.java:48)
>>> at
>>> com.hp.hpl.jena.rdfxml.xmloutput.impl.BaseXMLWriter.
>>> writeXMLBody(BaseXMLWriter.java:502)
>>> at
>>> com.hp.hpl.jena.rdfxml.xmloutput.impl.BaseXMLWriter.
>>> write(BaseXMLWriter.java:474)
>>> at com.hp.hpl.jena.rdf.model.impl.ModelCom.write(ModelCom.java:317)
>>> at com.hp.hpl.jena.ontology.impl.OntModelImpl.write(
>>> OntModelImpl.java:2631)
>>> at
>>> fci.cu.paas.provider.semantic.model.PaaSCloudProviderSemanticModel
>>> .saveOntoModel(PaaSCloudProviderSemanticModel.java:88)
>>> at
>>> fci.cu.paas.parser.based.on.reflection.SourceCode2Ontology.main(
>>> SourceCode2Ontology.java:33)
>>>
>>> I tried to insert my indiviuals manually using protege and it works with
>>> no
>>> problem.
>>> so, could you help me in inserting them using jena
>>>
>>>
>>
>
>


Re: com.hp.hpl.jena.shared.BadURIException: Code: 0/ILLEGAL_CHARACTER in FRAGMENT

Posted by Eman Hossny <e....@fci-cu.edu.eg>.
many thanks for ur reply.
but I need to represent my source code as ontology--> so how I can
represent multiple individuals with the same name, where I have multiple
overloaded methods which have the same name and they differ in the
parameters.
in the current state I used [] to pass parameters to methods--> by this way
I can create multiple individuals with the same name and different
parameters. however, using [] is not legal. Although, I have created
individuals in protege with names containing [] and it works with no
problem.

could you plz help me in this issue?

On Thu, Apr 9, 2015 at 6:43 PM, Andy Seaborne <an...@apache.org> wrote:

> "[" and "]" aren't legal in URIs at that point.
>
> They are only legal for IPv6 addresses in the host part.
>
>         Andy
>
>
> On 09/04/15 17:05, Eman Hossny wrote:
>
>> Hello All,
>>    I'm trying to use Jena API to insert individuals to my ontology with
>> names like the following:
>> com.microsoft.azure.storage.blob.CloudBlobClient.
>> getContainerReference[java.lang.String]
>> however, when I trying to save my new ontolog--> it gives me the following
>> exception (could you help me in this issue):
>> Exception in thread "main" com.hp.hpl.jena.shared.BadURIException: Only
>> well-formed absolute URIrefs can be included in RDF/XML output: <
>> http://www.cs.uwm.edu/~alnusair/ontologies/scro.owl#
>> com.microsoft.azure.storage.blob.CloudBlobClient.
>> getContainerReference[java.lang.String]>
>> Code: 0/ILLEGAL_CHARACTER in FRAGMENT: The character violates the grammar
>> rules for URIs/IRIs.
>> at
>> com.hp.hpl.jena.rdfxml.xmloutput.impl.BaseXMLWriter.
>> checkURI(BaseXMLWriter.java:835)
>> at
>> com.hp.hpl.jena.rdfxml.xmloutput.impl.BaseXMLWriter.
>> relativize(BaseXMLWriter.java:812)
>> at
>> com.hp.hpl.jena.rdfxml.xmloutput.impl.Basic.writeResourceReference(Basic.
>> java:156)
>> at
>> com.hp.hpl.jena.rdfxml.xmloutput.impl.Basic.
>> writePredicate(Basic.java:109)
>> at
>> com.hp.hpl.jena.rdfxml.xmloutput.impl.Basic.
>> writeRDFStatements(Basic.java:85)
>> at
>> com.hp.hpl.jena.rdfxml.xmloutput.impl.Basic.
>> writeRDFStatements(Basic.java:74)
>> at com.hp.hpl.jena.rdfxml.xmloutput.impl.Basic.writeBody(Basic.java:48)
>> at
>> com.hp.hpl.jena.rdfxml.xmloutput.impl.BaseXMLWriter.
>> writeXMLBody(BaseXMLWriter.java:502)
>> at
>> com.hp.hpl.jena.rdfxml.xmloutput.impl.BaseXMLWriter.
>> write(BaseXMLWriter.java:474)
>> at com.hp.hpl.jena.rdf.model.impl.ModelCom.write(ModelCom.java:317)
>> at com.hp.hpl.jena.ontology.impl.OntModelImpl.write(
>> OntModelImpl.java:2631)
>> at
>> fci.cu.paas.provider.semantic.model.PaaSCloudProviderSemanticModel
>> .saveOntoModel(PaaSCloudProviderSemanticModel.java:88)
>> at
>> fci.cu.paas.parser.based.on.reflection.SourceCode2Ontology.main(
>> SourceCode2Ontology.java:33)
>>
>> I tried to insert my indiviuals manually using protege and it works with
>> no
>> problem.
>> so, could you help me in inserting them using jena
>>
>>
>


-- 
Eman Hossny,
Teacher Assistant,
Computer Science Department,
Faculty of Computers and Information
Cairo University, Egypt

-- 


Re: com.hp.hpl.jena.shared.BadURIException: Code: 0/ILLEGAL_CHARACTER in FRAGMENT

Posted by Andy Seaborne <an...@apache.org>.
"[" and "]" aren't legal in URIs at that point.

They are only legal for IPv6 addresses in the host part.

	Andy

On 09/04/15 17:05, Eman Hossny wrote:
> Hello All,
>    I'm trying to use Jena API to insert individuals to my ontology with
> names like the following:
> com.microsoft.azure.storage.blob.CloudBlobClient.getContainerReference[java.lang.String]
> however, when I trying to save my new ontolog--> it gives me the following
> exception (could you help me in this issue):
> Exception in thread "main" com.hp.hpl.jena.shared.BadURIException: Only
> well-formed absolute URIrefs can be included in RDF/XML output: <
> http://www.cs.uwm.edu/~alnusair/ontologies/scro.owl#com.microsoft.azure.storage.blob.CloudBlobClient.getContainerReference[java.lang.String]>
> Code: 0/ILLEGAL_CHARACTER in FRAGMENT: The character violates the grammar
> rules for URIs/IRIs.
> at
> com.hp.hpl.jena.rdfxml.xmloutput.impl.BaseXMLWriter.checkURI(BaseXMLWriter.java:835)
> at
> com.hp.hpl.jena.rdfxml.xmloutput.impl.BaseXMLWriter.relativize(BaseXMLWriter.java:812)
> at
> com.hp.hpl.jena.rdfxml.xmloutput.impl.Basic.writeResourceReference(Basic.java:156)
> at
> com.hp.hpl.jena.rdfxml.xmloutput.impl.Basic.writePredicate(Basic.java:109)
> at
> com.hp.hpl.jena.rdfxml.xmloutput.impl.Basic.writeRDFStatements(Basic.java:85)
> at
> com.hp.hpl.jena.rdfxml.xmloutput.impl.Basic.writeRDFStatements(Basic.java:74)
> at com.hp.hpl.jena.rdfxml.xmloutput.impl.Basic.writeBody(Basic.java:48)
> at
> com.hp.hpl.jena.rdfxml.xmloutput.impl.BaseXMLWriter.writeXMLBody(BaseXMLWriter.java:502)
> at
> com.hp.hpl.jena.rdfxml.xmloutput.impl.BaseXMLWriter.write(BaseXMLWriter.java:474)
> at com.hp.hpl.jena.rdf.model.impl.ModelCom.write(ModelCom.java:317)
> at com.hp.hpl.jena.ontology.impl.OntModelImpl.write(OntModelImpl.java:2631)
> at
> fci.cu.paas.provider.semantic.model.PaaSCloudProviderSemanticModel.saveOntoModel(PaaSCloudProviderSemanticModel.java:88)
> at
> fci.cu.paas.parser.based.on.reflection.SourceCode2Ontology.main(SourceCode2Ontology.java:33)
>
> I tried to insert my indiviuals manually using protege and it works with no
> problem.
> so, could you help me in inserting them using jena
>