[redland] Silly questions

James Michael DuPont mdupont777 at yahoo.com
Thu Dec 5 09:39:57 GMT 2002


Silly question time: 
1. how to use some features like datayped literals

from the changelog :
>>* Added support for RDF datatyped literals in RDF/XML with
>>rdf:datatype attribute on property elements and
>>N-Triples with "string"^^<datatypeURIref>.
How can I create such beasts in redland?

Also, I would like to give datatypes on resources themselves, 
right now i use more statements like this :

here is the statement about its type:
<./nodes/node-ids#id-2910> 
<http://purl.oclc.org/NET/introspector/2002/11/24/gcc/node_fields#type
>
<http://purl.oclc.org/NET/introspector/2002/11/24/gcc/node_types#array
_type>
.

and here that it is a string_cst
<./nodes/node-ids#id-2910>
<http://purl.oclc.org/NET/introspector/2002/11/24/gcc/node_fields#stri
ng>
<./nodes/node-strings#dequeue_and_dump> .

<./nodes/node-ids#id-2910>
<http://purl.oclc.org/NET/introspector/2002/11/24/gcc/node_fields#tree
-code>
<http://purl.oclc.org/NET/introspector/2002/11/24/gcc/node_types#strin
g_cst>
.

>>* Reorganised the source into separate modules - URI, xml parser,
>>ntriples parser, XML namespaces, XML qnames, locator.
How can I make the uris use these? and reference a namespace,
for example 
<?xml version="1.0"?>
<RDF
  xmlns:gcc="http://purl.oclc.org/NET/introspector/2002/11/24/gcc/">
</RDF>

Right now I use two functions in redland :
this is to create a local name :
 pobject=  librdf_new_node_from_uri_local_name(di->pworld, 
						pobject_base, 
						pstring);
And this to create a literal :
  pobject=  librdf_new_node_from_literal(di->pworld, 
					 pstring,
					 NULL,
					 0); // create a new node

Then the predicates are added in to a statement,

I use for items in my file, this base uri, 
but this is referencing a local now, that is relative to the file
pcurrent_uri  =librdf_new_uri(di->pworld,"./nodes/node-ids#");

how can I now define this "./nodes/node-ids#id-2"?
if i create a file ./nodes/node-ids and put a node in there like 

-----------------------------
plocal_uri  =librdf_new_uri(di->pworld,"#");
pobject=  librdf_new_node_from_uri_local_name(di->pworld, 
						plocal_uri, 
						pstring);

would that be the best way to reference a local uri?

Also, I would like to group all the data together into 
"Basic Abbreviated Syntax", is this possible?

Oh yes one more issue :
What about malloc/calloc, I have tried to rename them to xmalloc and 
xcalloc for cygwin, but still have problems. In the gcc under cygwin, 
the malloc is poisoned, in gentoo as well. I cannot link the redland 
to gcc on cygwin, and on gentoo right now. If I change that to 
xmalloc, it segfaults. Any ideas?

mike











More information about the redland-dev mailing list