|
From: Richard C. <ri...@cy...> - 2006-05-30 11:07:33
|
Hi AJ,
On 30 May 2006, at 09:00, AJ Chen wrote:
> I debuged it with Jena and fixed the RDF file. Now, I can read/
> write ontology in RDF/XML with RAP. RAP is great! I'm using it to
> develop plugins for semantic web support.
:-)
> Another question: how to control what default namespaces to use?
> there are some default namespaces that I don't want to write into
> rdf file. I know they can be removed by calling the remove method
> on model. But, if there is a config file listing these namespaces,
> then it will be easier to add and remove. Please give me a pointer.
Have a look at api/constants.php, there's this section:
//
------------------------------------------------------------------------
----------
// RDQL, SPARQL and parser default namespace prefixes
//
------------------------------------------------------------------------
----------
$default_prefixes = array(
RDF_NAMESPACE_PREFIX => RDF_NAMESPACE_URI,
RDF_SCHEMA_PREFIX => RDF_SCHEMA_URI,
'xsd' => 'http://www.w3.org/2001/XMLSchema#',
OWL_PREFIX => OWL_URI,
'dc' => 'http://purl.org/dc/elements/1.1/',
'dcterms' => 'http://purl.org/dc/terms/',
'vcard' => 'http://www.w3.org/2001/vcard-rdf/3.0#',
'kb_sys' => 'http://purl.org/knowledgebay/ontology/sys#',
'kb_person' => 'http://purl.org/knowledgebay/ontology/person#',
'kb_keyword' => 'http://purl.org/knowledgebay/ontology/keyword#',
'kb_lecture' => 'http://purl.org/knowledgebay/ontology/lecture#',
'kb_location' => 'http://purl.org/knowledgebay/ontology/location#'
);
Just remove those you don't want.
Richard
>
> Thanks,
> AJ
>
> On 5/29/06, Richard Cyganiak <ri...@cy...> wrote: Hi AJ,
>
> can you please post the complete RDF file (or make it available
> online and send a link)? Have you checked it against the RDF
> validator [1]? Which PHP version are you using? The snippet looks
> fine and RAP shouldn't have trouble with it.
>
> Cheers,
> Richard
>
> [1] http://www.w3.org/RDF/Validator/
>
>
> On 29 May 2006, at 05:45, AJ Chen wrote:
>
> > Hi, I'm new to RAP, trying to use RAP to load a DOAP file. But,
> > there is a fatal error:
> >
> > PHP Fatal error: RDFAPI error (class: parser; method:
> > generateModel): XML-parser-error 201 in Line 13 of input document.
> >
> > line 13 is <doap:shortdesc> in the following rdf section:
> > <doap:Project>
> > <doap:name>Redland RDF Application Framework</doap:name>
> > <doap:homepage rdf:resource="http://
> > www.redland.opensource.ac.uk/" />
> > <doap:created>2000-06-21</doap:created>
> > <doap:shortdesc>
> > A library for the Resource Description Framework (RDF)
> > allowing
> > it parsed from XML, stored, queried and
> > manipulated.
> > </doap:shortdesc>
> > ....
> >
> > my code to load ontology is:
> >
> > $ontModel = ModelFactory::getOntModel(MEMMODEL,RDFS_VOCABULARY);
> > $ontModel->load("doap_redland.rdf");
> >
> > Any suggestion for loading DOAP file? I assume RAP knows how to
> > load instance of any class like doap:Project. If this is not true,
> > then how to have RAP to work with a custom ontology?
> >
> > Thanks,
> > AJ
>
>
|