[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: libquran in embedded environment



Salaam Abdulhaq,

Yes I understand, with C it is probably a whole different experience working with XML. I come from a Java background so as you say working with XML in Java (with JDOM) is just as easy as working with plain Java objects.

In regards to searching and querying (and performance).. well the new XQuery from W3C.org saves the day:
http://www.xquery.com/
http://www.w3.org/TR/xquery/
I don't know about C but in Java at least working with XML must become a breeze together with JDOM and a Java implementation of XQuery. Essentially XQuery is to XML what SQL is to relational databases. Couple that up with a lightweight open-source Java-based XML database such as eXist http://exist.sourceforge.net/ and you got the indexing functionality too.

So I guess the problem of working with XML in C/C++ lies in the lack of necessary C/C++ based tools similar to those in the Java world. I guess the ultimate solution would be to port libquran to Java then. I remember somebody who committed a Java port of libquran. What happened to that code?

Thanks,
Mete

---------- Original Message ----------------------------------
From: Abdulhaq Lynch <al-arabeyes at alinsyria dot fsnet dot co dot uk>
Date:  Wed, 25 May 2005 19:06:35 +0100

>On Wednesday 25 May 2005 10:11, Mete Kural wrote:
>> >As an aside, my personal opinion is that XML is great for transporting
>> > data between applications, but is poor for the internal representation of
>> > data in the vast majority of applications. I prefer to have a simple
>> > native object-oriented view of the data in my apps, and import and export
>> > to XML as and when it's required.
>>
>> Actually there is an XML schema called OSIS
>> (http://www.bibletechnologies.net/) that is perfect for storing the Quran
>> and all translations in. I checked it out a while back. It is originally
>> intended for the Bible but the way it is designed it can be easily used for
>> the Quran too. I talked to the OSIS people and they supported the idea of
>> using OSIS to store Quran'ic data. They are also planning to build a plugin
>> for OpenOffice in order to edit OSIS documents out-of-the-box.
>>
>> For your information,
>> Mete
>
>The important aspect of any schema is that its structure  mirrors sufficiently 
>accurately the real-life data so that the real data can be stored in it, 
>searched etc. I haven't looked at OSIS but I don't doubt the the schema is 
>well suited to Quranic data.
>
>However, my point is that rather than having this schema in XML, I prefer to 
>have it in my native language's objects or a database - for instance, an ayat 
>would be, in C++, an instance of an Ayat class rather than  a DOM XML 
>element. It could also be a row in a table of aayaats.
>
>With some languages, like java using JDOM, there isn't much difference in ease 
>of use between XML and native objects. However, compared to using C and 
>libexpat, an sqlite database seems like a much simpler solution to code up 
>and maintain.
>
>Perhaps I'm biased, after all my background is large databases with many 
>tables. One definite advantage to using a database is that the database 
>engine has been optimised for searches. When XML is used as the data storage 
>format then search algorithms have to be hand-crafted, which could be 
>difficult (to do efficiently) for complicated queries that cross entity 
>types. Databases can also have indexes to make searches faster, which would 
>have to implemented by hand in the XML world.
>
>The schema in the database would match that in XML  - it's just the data is 
>easier and quicker to search and maintain in a database.
>
>Anyway, each developer has to choose his own favourite poison! It's just an 
>option to consider,
>
>wassalaam
>abdulhaq
>

--
Mete Kural
Touchtone Corporation
714-755-2810
--