You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by Nogales Moyano Alberto <al...@uah.es> on 2013/11/14 21:55:27 UTC

Retrieve information from a .rdf ontology

Dear all I am working with various ontologies some of them are in .owl and other .rdf. I have no problem with .owl files but when I try to load .rdf file I have errors. Here is my code for .owl, maybe the problems is with the model.

OntModel model = ModelFactory.createOntologyModel();


model.read("/ont/Indiana.rdf", "RDF/XML");
Query query = QueryFactory.create(SPARQLquery);

The error is:

Exception in thread "main" org.apache.jena.riot.RiotException: Element or attribute do not match QName production: QName::=(NCName':')?NCName.
at org.apache.jena.riot.system.ErrorHandlerFactory$ErrorHandlerStd.fatal(ErrorHandlerFactory.java:136)

Thank you and regards.
______________________________

Alberto Nogales Moyano
Information engineering research unit
University of Alcalá


El 14/11/2013, a las 21:30, <de...@jena.apache.org>>
 escribió:

Hi! This is the ezmlm program. I'm managing the
dev@jena.apache.org<ma...@jena.apache.org> mailing list.

I'm working for my owner, who can be reached
at dev-owner@jena.apache.org<ma...@jena.apache.org>.

Acknowledgment: I have added the address

  alberto.nogales@uah.es<ma...@uah.es>

to the dev mailing list.

Welcome to dev@jena.apache.org<ma...@jena.apache.org>!

Please save this message so that you know the address you are
subscribed under, in case you later want to unsubscribe or change your
subscription address.


--- Administrative commands for the dev list ---

I can handle administrative requests automatically. Please
do not send them to the list address! Instead, send
your message to the correct command address:

To subscribe to the list, send a message to:
  <de...@jena.apache.org>>

To remove your address from the list, send a message to:
  <de...@jena.apache.org>>

Send mail to the following for info and FAQ for this list:
  <de...@jena.apache.org>>
  <de...@jena.apache.org>>

Similar addresses exist for the digest list:
  <de...@jena.apache.org>>
  <de...@jena.apache.org>>

To get messages 123 through 145 (a maximum of 100 per request), mail:
  <de...@jena.apache.org>>

To get an index with subject and author for messages 123-456 , mail:
  <de...@jena.apache.org>>

They are always returned as sets of 100, max 2000 per request,
so you'll actually get 100-499.

To receive all messages with the same subject as message 12345,
send a short message to:
  <de...@jena.apache.org>>

The messages should contain one line or word of text to avoid being
treated as sp@m, but I will ignore their content.
Only the ADDRESS you send to is important.

You can start a subscription for an alternate address,
for example "john@host.domain<ma...@host.domain>", just add a hyphen and your
address (with '=' instead of '@') after the command word:
<de...@jena.apache.org>>

To stop subscription for this address, mail:
<de...@jena.apache.org>>

In both cases, I'll send a confirmation message to that address. When
you receive it, simply reply to it to complete your subscription.

If despite following these instructions, you do not get the
desired results, please contact my owner at
dev-owner@jena.apache.org<ma...@jena.apache.org>. Please be patient, my owner is a
lot slower than I am ;-)

--- Enclosed is a copy of the request I received.

Return-Path: <al...@uah.es>>
Received: (qmail 66197 invoked by uid 99); 14 Nov 2013 20:30:46 -0000
Received: from nike.apache.org<http://nike.apache.org> (HELO nike.apache.org<http://nike.apache.org>) (192.87.106.230)
   by apache.org<http://apache.org> (qpsmtpd/0.29) with ESMTP; Thu, 14 Nov 2013 20:30:46 +0000
X-ASF-Spam-Status: No, hits=-0.0 required=5.0
tests=RCVD_IN_DNSWL_NONE,SPF_PASS
X-Spam-Check-By: apache.org<http://apache.org>
Received-SPF: pass (nike.apache.org<http://nike.apache.org>: domain of alberto.nogales@uah.es<ma...@uah.es> designates 213.199.154.75 as permitted sender)
Received: from [213.199.154.75] (HELO emea01-db3-obe.outbound.protection.outlook.com) (213.199.154.75)
   by apache.org<http://apache.org> (qpsmtpd/0.29) with ESMTP; Thu, 14 Nov 2013 20:30:38 +0000
Received: from DBXPR03MB111.eurprd03.prod.outlook.com<http://eurprd03.prod.outlook.com> (10.242.139.15) by
DBXPR03MB110.eurprd03.prod.outlook.com<http://eurprd03.prod.outlook.com> (10.242.139.14) with Microsoft SMTP
Server (TLS) id 15.0.820.5; Thu, 14 Nov 2013 20:30:17 +0000
Received: from DBXPR03MB111.eurprd03.prod.outlook.com<http://eurprd03.prod.outlook.com> ([169.254.16.100]) by
DBXPR03MB111.eurprd03.prod.outlook.com<http://eurprd03.prod.outlook.com> ([169.254.16.100]) with mapi id
15.00.0820.005; Thu, 14 Nov 2013 20:30:17 +0000
From: Nogales Moyano Alberto <al...@uah.es>>
To:
"dev-sc.1384460923.meocgeadcgjfhkdadcec-alberto.nogales=uah.es@jena.apache.org<ma...@jena.apache.org>"
<de...@jena.apache.org>>
Subject:
Thread-Index: AQHO4XhUXKIOLcJydEO/7NPcPlOj2Q==
Date: Thu, 14 Nov 2013 20:30:16 +0000
Message-ID: <5585802A-37D0-4A53-9994-194646D42BF7@uah.es<http://uah.es>>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-originating-ip: [80.27.103.234]
x-forefront-prvs: 0030839EEE
x-forefront-antispam-report: SFV:NSPM;SFS:(199002)(189002)(81686001)(81342001)(74366001)(66066001)(65816001)(80022001)(80976001)(83322001)(36756003)(63696002)(81542001)(76176001)(85306002)(5406001)(74876001)(46102001)(25636003)(558084003)(33656001)(4396001)(83072001)(51856001)(83716003)(47736001)(54316002)(49866001)(47976001)(50986001)(31966008)(87266001)(56776001)(77096001)(56816003)(74662001)(54356001)(74482001)(47446002)(74502001)(76482001)(81816001)(79102001)(53806001)(77982001)(59766001)(69226001)(74706001)(2656002)(76786001)(76796001)(87936001)(82746002)(5416002);DIR:OUT;SFP:;SCL:1;SRVR:DBXPR03MB110;H:DBXPR03MB111.eurprd03.prod.outlook.com<http://eurprd03.prod.outlook.com>;CLIP:80.27.103.234;FPR:;RD:InfoNoRecords;A:1;MX:1;LANG:en;
Content-Type: text/plain; charset="iso-8859-1"
Content-ID: <AC...@eurprd03.prod.outlook.com>>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: uah.es<http://uah.es>
X-Virus-Checked: Checked by ClamAV on apache.org<http://apache.org>



Re: Retrieve information from a .rdf ontology

Posted by Andy Seaborne <an...@apache.org>.
On 14/11/13 20:55, Nogales Moyano Alberto wrote:
> Dear all I am working with various ontologies some of them are in
> .owl  and other .rdf. I have no problem with .owl files but when
 >  I try to load .rdf file I have errors. Here is my code for .owl,
> maybe the problems is with the model.
> OntModel model = ModelFactory.createOntologyModel();
>
>
> model.read("/ont/Indiana.rdf", "RDF/XML");
> Query query = QueryFactory.create(SPARQLquery);
>
> The error is:
>
> Exception in thread "main" org.apache.jena.riot.RiotException: Element or attribute do not match QName production: QName::=(NCName':')?NCName.
> at org.apache.jena.riot.system.ErrorHandlerFactory$ErrorHandlerStd.fatal(ErrorHandlerFactory.java:136)

There should be more of stacktrace than this.

It looks like there a problem in the data - the error is an XML error. 
The RDf/XML parser is correctly invoked but somewhere in your data there 
is illegal XML. A tag does not match the XML rules of <name:name>.

	Andy