Changeset 72 for php/trunk/classes/rdfa_Data.php
- Timestamp:
- Oct 24, 2011, 2:50:17 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
php/trunk/classes/rdfa_Data.php
r69 r72 472 472 $this->debugger->sendMessage( $debugMessage, self::debugcontext); 473 473 474 $index = $query->run(); 475 if ($index !== false) 476 $newTriples = \ARC2::getTriplesFromIndex( $index); 477 else 478 $newTriples = array(); 479 474 $newTriples = $query->run(); 475 480 476 } else { 481 477 … … 487 483 $this->debugger->sendMessage( $debugMessage, self::debugcontext); 488 484 489 $arcParser = \ARC2::getRDFParser(); 490 $arcParser->parse( $uri); 491 $newTriples = $arcParser->getTriples(); 485 $core = new \rdfint_core\Core(); 486 $newTriples = $core->parse( $uri); 492 487 } 493 488 // could something be parsed ? … … 1081 1076 */ 1082 1077 public function _serialize( $type ) { 1083 // set the supported types and shortcut them to the ones we use in there 1084 $validTypes = array( 'application/rdf+xml' => 'rdfxml' , 1085 'application/rdfxml' => 'rdfxml', 1086 'text/turtle' => 'turtle', 1087 'application/x-turtle' => 'turtle', 1088 'text/n3' => 'n3', 1089 'application/json' => 'json'); 1090 1091 // check if explicit mime type is specified 1092 if (isset( $validTypes[ $type])) { 1093 $type = $validTypes[ $type]; 1094 } else { 1095 // check if internal type is given 1096 $internalTypes = array_unique( array_flip( $validTypes)); 1097 if (!isset( $internalTypes[ $type])) 1098 return false; 1099 } 1100 1101 switch ($type) { 1102 1103 case 'rdfxml': 1104 $ser = \ARC2::getRDFXMLSerializer(); 1105 break; 1106 1107 case 'turtle': 1108 $ser = \ARC2::getTurtleSerializer(); 1109 break; 1110 1111 case 'n3': 1112 $ser = \ARC2::getNTriplesSerializer(); 1113 break; 1114 1115 case 'json': 1116 $ser = \ARC2::getRDFJSONSerializer(); 1117 break; 1118 1119 } // switch ($type) 1120 1121 return $ser->getSerializedTriples( $this->aTriples); 1078 1079 $core = new \rdfint_core\Core(); 1080 return $core->serialize( $this->aTriples, $type); 1122 1081 1123 1082 } // public function _serialize 1124 1083 1125 1084 1126 1085 } // class Data
Note:
See TracChangeset
for help on using the changeset viewer.