public static function createLanguageDescription($code, $label)
    {
        $returnValue = null;

        $languageType = tao_models_classes_LanguageService::CLASS_URI_LANGUAGES;
        $languagePrefix = 'http://www.tao.lu/Ontologies/TAO.rdf#Lang';
        $rdfNs = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#';
        $rdfsNs = 'http://www.w3.org/2000/01/rdf-schema#';
        $xmlNs = 'http://www.w3.org/XML/1998/namespace';
        $xmlnsNs = 'http://www.w3.org/2000/xmlns/';
        $base = 'http://www.tao.lu/Ontologies/TAO.rdf#';
        
        $doc = new DomDocument('1.0', 'UTF-8');
        $doc->formatOutput = true;
        
        $rdfNode = $doc->createElementNS($rdfNs, 'rdf:RDF');
        $rdfNode->setAttributeNS($xmlNs, 'xml:base', $base);
        $doc->appendChild($rdfNode);
        
        $descriptionNode = $doc->createElementNS($rdfNs, 'rdf:Description');
        $descriptionNode->setAttributeNS($rdfNs, 'rdf:about', $languagePrefix . $code);
        $rdfNode->appendChild($descriptionNode);
        
        $typeNode = $doc->createElementNS($rdfNs, 'rdf:type');
        $typeNode->setAttributeNS($rdfNs, 'rdf:resource', $languageType);
        $descriptionNode->appendChild($typeNode);
        
        $labelNode = $doc->createElementNS($rdfsNs, 'rdfs:label');
        $labelNode->setAttributeNS($xmlNs, 'xml:lang', DEFAULT_LANG);
        $labelNode->appendChild($doc->createCDATASection($label));
        $descriptionNode->appendChild($labelNode);
        
        $valueNode = $doc->createElementNS($rdfNs, 'rdf:value');
        $valueNode->appendChild($doc->createCDATASection($code));
        $descriptionNode->appendChild($valueNode);
        
        $guiUsageNode = $doc->createElementNS($base, 'tao:LanguageUsages');
        $guiUsageNode->setAttributeNs($rdfNs, 'rdf:resource', tao_models_classes_LanguageService::INSTANCE_LANGUAGE_USAGE_GUI);
        $descriptionNode->appendChild($guiUsageNode);

        $dataUsageNode = $doc->createElementNS($base, 'tao:LanguageUsages');
        $dataUsageNode->setAttributeNs($rdfNs, 'rdf:resource', tao_models_classes_LanguageService::INSTANCE_LANGUAGE_USAGE_DATA);
        $descriptionNode->appendChild($dataUsageNode);
        
        $dataUsageNode = $doc->createElementNS($base, 'tao:LanguageOrientation');
        $dataUsageNode->setAttributeNs($rdfNs, 'rdf:resource', tao_models_classes_LanguageService::INSTANCE_ORIENTATION_LTR);
        $descriptionNode->appendChild($dataUsageNode);
        
        $returnValue = $doc;

        return $returnValue;
    }
public static function createLanguageDescription($code, $label)
    {
        $returnValue = null;

        $languageType = tao_models_classes_LanguageService::CLASS_URI_LANGUAGES;
        $languagePrefix = 'http://www.tao.lu/Ontologies/TAO.rdf#Lang';
        $rdfNs = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#';
        $rdfsNs = 'http://www.w3.org/2000/01/rdf-schema#';
        $xmlNs = 'http://www.w3.org/XML/1998/namespace';
        $xmlnsNs = 'http://www.w3.org/2000/xmlns/';
        $base = 'http://www.tao.lu/Ontologies/TAO.rdf#';
        
        $doc = new DomDocument('1.0', 'UTF-8');
        $doc->formatOutput = true;
        
        $rdfNode = $doc->createElementNS($rdfNs, 'rdf:RDF');
        $rdfNode->setAttributeNS($xmlNs, 'xml:base', $base);
        $doc->appendChild($rdfNode);
        
        $descriptionNode = $doc->createElementNS($rdfNs, 'rdf:Description');
        $descriptionNode->setAttributeNS($rdfNs, 'rdf:about', $languagePrefix . $code);
        $rdfNode->appendChild($descriptionNode);
        
        $typeNode = $doc->createElementNS($rdfNs, 'rdf:type');
        $typeNode->setAttributeNS($rdfNs, 'rdf:resource', $languageType);
        $descriptionNode->appendChild($typeNode);
        
        $labelNode = $doc->createElementNS($rdfsNs, 'rdfs:label');
        $labelNode->setAttributeNS($xmlNs, 'xml:lang', DEFAULT_LANG);
        $labelNode->appendChild($doc->createCDATASection($label));
        $descriptionNode->appendChild($labelNode);
        
        $valueNode = $doc->createElementNS($rdfNs, 'rdf:value');
        $valueNode->appendChild($doc->createCDATASection($code));
        $descriptionNode->appendChild($valueNode);
        
        $guiUsageNode = $doc->createElementNS($base, 'tao:LanguageUsages');
        $guiUsageNode->setAttributeNs($rdfNs, 'rdf:resource', tao_models_classes_LanguageService::INSTANCE_LANGUAGE_USAGE_GUI);
        $descriptionNode->appendChild($guiUsageNode);

        $dataUsageNode = $doc->createElementNS($base, 'tao:LanguageUsages');
        $dataUsageNode->setAttributeNs($rdfNs, 'rdf:resource', tao_models_classes_LanguageService::INSTANCE_LANGUAGE_USAGE_DATA);
        $descriptionNode->appendChild($dataUsageNode);
        
        $dataUsageNode = $doc->createElementNS($base, 'tao:LanguageOrientation');
        $dataUsageNode->setAttributeNs($rdfNs, 'rdf:resource', tao_models_classes_LanguageService::INSTANCE_ORIENTATION_LTR);
        $descriptionNode->appendChild($dataUsageNode);
        
        $returnValue = $doc;

        return $returnValue;
    }
public static function createLanguageDescription ( $ code , $ label ) { $ returnValue = null ; $ languageType = tao_models_classes_LanguageService :: CLASS_URI_LANGUAGES ; $ languagePrefix = 'http://www.tao.lu/Ontologies/TAO.rdf#Lang' ; $ rdfNs = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#' ; $ rdfsNs = 'http://www.w3.org/2000/01/rdf-schema#' ; $ xmlNs = 'http://www.w3.org/XML/1998/namespace' ; $ xmlnsNs = 'http://www.w3.org/2000/xmlns/' ; $ base = 'http://www.tao.lu/Ontologies/TAO.rdf#' ; $ doc = new DomDocument ( '1.0' , 'UTF-8' ) ; $ doc -> formatOutput = true ; $ rdfNode = $ doc -> createElementNS ( $ rdfNs , 'rdf:RDF' ) ; $ rdfNode -> setAttributeNS ( $ xmlNs , 'xml:base' , $ base ) ; $ doc -> appendChild ( $ rdfNode ) ; $ descriptionNode = $ doc -> createElementNS ( $ rdfNs , 'rdf:Description' ) ; $ descriptionNode -> setAttributeNS ( $ rdfNs , 'rdf:about' , $ languagePrefix . $ code ) ; $ rdfNode -> appendChild ( $ descriptionNode ) ; $ typeNode = $ doc -> createElementNS ( $ rdfNs , 'rdf:type' ) ; $ typeNode -> setAttributeNS ( $ rdfNs , 'rdf:resource' , $ languageType ) ; $ descriptionNode -> appendChild ( $ typeNode ) ; $ labelNode = $ doc -> createElementNS ( $ rdfsNs , 'rdfs:label' ) ; $ labelNode -> setAttributeNS ( $ xmlNs , 'xml:lang' , DEFAULT_LANG ) ; $ labelNode -> appendChild ( $ doc -> createCDATASection ( $ label ) ) ; $ descriptionNode -> appendChild ( $ labelNode ) ; $ valueNode = $ doc -> createElementNS ( $ rdfNs , 'rdf:value' ) ; $ valueNode -> appendChild ( $ doc -> createCDATASection ( $ code ) ) ; $ descriptionNode -> appendChild ( $ valueNode ) ; $ guiUsageNode = $ doc -> createElementNS ( $ base , 'tao:LanguageUsages' ) ; $ guiUsageNode -> setAttributeNs ( $ rdfNs , 'rdf:resource' , tao_models_classes_LanguageService :: INSTANCE_LANGUAGE_USAGE_GUI ) ; $ descriptionNode -> appendChild ( $ guiUsageNode ) ; $ dataUsageNode = $ doc -> createElementNS ( $ base , 'tao:LanguageUsages' ) ; $ dataUsageNode -> setAttributeNs ( $ rdfNs , 'rdf:resource' , tao_models_classes_LanguageService :: INSTANCE_LANGUAGE_USAGE_DATA ) ; $ descriptionNode -> appendChild ( $ dataUsageNode ) ; $ dataUsageNode = $ doc -> createElementNS ( $ base , 'tao:LanguageOrientation' ) ; $ dataUsageNode -> setAttributeNs ( $ rdfNs , 'rdf:resource' , tao_models_classes_LanguageService :: INSTANCE_ORIENTATION_LTR ) ; $ descriptionNode -> appendChild ( $ dataUsageNode ) ; $ returnValue = $ doc ; return $ returnValue ; }
Creates a language description file for TAO using the RDF-XML language.

@access public
@author Jerome Bogaerts <jerome@taotesting.com>
@param  string code string code The language code e.g. fr-FR.
@param  string label string label The language label e.g. French in english.
@return DomDocument
Creates a language description file for TAO using the RDF - XML language .