@@ -277,14 +277,12 @@ public function h1Open($t, $a)
277
277
if (isset ($ a [$ this ->rdf .'ID ' ])) {
278
278
$ s ['type ' ] = 'uri ' ;
279
279
$ s ['value ' ] = $ this ->calcURI ('# ' .$ a [$ this ->rdf .'ID ' ], $ s ['x_base ' ]);
280
- }
281
- /* about */
282
- elseif (isset ($ a [$ this ->rdf .'about ' ])) {
280
+ } elseif (isset ($ a [$ this ->rdf .'about ' ])) {
281
+ /* about */
283
282
$ s ['type ' ] = 'uri ' ;
284
283
$ s ['value ' ] = $ this ->calcURI ($ a [$ this ->rdf .'about ' ], $ s ['x_base ' ]);
285
- }
286
- /* bnode */
287
- else {
284
+ } else {
285
+ /* bnode */
288
286
$ s ['type ' ] = 'bnode ' ;
289
287
if (isset ($ a [$ this ->rdf .'nodeID ' ])) {
290
288
$ s ['value ' ] = '_: ' .$ a [$ this ->rdf .'nodeID ' ];
@@ -301,16 +299,14 @@ public function h1Open($t, $a)
301
299
$ this ->addT ($ sup_s ['value ' ], $ sup_s ['p ' ], $ coll ['value ' ], $ sup_s ['type ' ], $ coll ['type ' ]);
302
300
$ this ->addT ($ coll ['value ' ], $ this ->rdf .'first ' , $ s ['value ' ], $ coll ['type ' ], $ s ['type ' ]);
303
301
$ this ->pushS ($ coll );
304
- }
305
- /* new entry in existing coll */
306
- elseif (isset ($ sup_s ['is_coll ' ]) && $ sup_s ['is_coll ' ]) {
302
+ } elseif (isset ($ sup_s ['is_coll ' ]) && $ sup_s ['is_coll ' ]) {
303
+ /* new entry in existing coll */
307
304
$ coll = ['value ' => $ this ->createBnodeID (), 'type ' => 'bnode ' , 'is_coll ' => true , 'x_base ' => $ s ['x_base ' ], 'x_lang ' => $ s ['x_lang ' ]];
308
305
$ this ->addT ($ sup_s ['value ' ], $ this ->rdf .'rest ' , $ coll ['value ' ], $ sup_s ['type ' ], $ coll ['type ' ]);
309
306
$ this ->addT ($ coll ['value ' ], $ this ->rdf .'first ' , $ s ['value ' ], $ coll ['type ' ], $ s ['type ' ]);
310
307
$ this ->pushS ($ coll );
311
- }
312
- /* normal sub-node */
313
- elseif (isset ($ sup_s ['p ' ]) && $ sup_s ['p ' ]) {
308
+ } elseif (isset ($ sup_s ['p ' ]) && $ sup_s ['p ' ]) {
309
+ /* normal sub-node */
314
310
$ this ->addT ($ sup_s ['value ' ], $ sup_s ['p ' ], $ s ['value ' ], $ sup_s ['type ' ], $ s ['type ' ]);
315
311
}
316
312
}
@@ -328,7 +324,10 @@ public function h1Open($t, $a)
328
324
}
329
325
/* any other attrs (skip rdf and xml, except rdf:_, rdf:value, rdf:Seq) */
330
326
foreach ($ a as $ k => $ v ) {
331
- if (((!str_contains ($ k , $ this ->xml )) && (!str_contains ($ k , $ this ->rdf ))) || preg_match ('/(\_[0-9]+|value|Seq|Bag|Alt|Statement|Property|List)$/ ' , $ k )) {
327
+ if (
328
+ ((!str_contains ($ k , $ this ->xml )) && (!str_contains ($ k , $ this ->rdf )))
329
+ || preg_match ('/(\_[0-9]+|value|Seq|Bag|Alt|Statement|Property|List)$/ ' , $ k )
330
+ ) {
332
331
if (strpos ($ k , ': ' )) {
333
332
$ this ->addT ($ s ['value ' ], $ k , $ v , $ s ['type ' ], 'literal ' , '' , $ s ['x_lang ' ]);
334
333
}
@@ -385,9 +384,8 @@ public function h2Open($t, $a)
385
384
unset($ s ['p_id ' ]);
386
385
}
387
386
$ this ->state = 3 ;
388
- }
389
- /* named bnode */
390
- elseif (isset ($ a [$ this ->rdf .'nodeID ' ])) {
387
+ } elseif (isset ($ a [$ this ->rdf .'nodeID ' ])) {
388
+ /* named bnode */
391
389
$ o ['value ' ] = '_: ' .$ a [$ this ->rdf .'nodeID ' ];
392
390
$ o ['type ' ] = 'bnode ' ;
393
391
$ this ->addT ($ s ['value ' ], $ s ['p ' ], $ o ['value ' ], $ s ['type ' ], $ o ['type ' ]);
@@ -396,9 +394,8 @@ public function h2Open($t, $a)
396
394
if (isset ($ s ['p_id ' ])) {
397
395
$ this ->reify ($ this ->calcURI ('# ' .$ s ['p_id ' ], $ b ), $ s ['value ' ], $ s ['p ' ], $ o ['value ' ], $ s ['type ' ], $ o ['type ' ]);
398
396
}
399
- }
400
- /* parseType */
401
- elseif (isset ($ a [$ this ->rdf .'parseType ' ])) {
397
+ } elseif (isset ($ a [$ this ->rdf .'parseType ' ])) {
398
+ /* parseType */
402
399
if ('Literal ' === $ a [$ this ->rdf .'parseType ' ]) {
403
400
$ s ['o_xml_level ' ] = 0 ;
404
401
$ s ['o_xml_data ' ] = '' ;
@@ -421,9 +418,8 @@ public function h2Open($t, $a)
421
418
$ s ['o_is_coll ' ] = true ;
422
419
$ this ->state = 4 ;
423
420
}
424
- }
425
- /* sub-node or literal */
426
- else {
421
+ } else {
422
+ /* sub-node or literal */
427
423
$ s ['o_cdata ' ] = '' ;
428
424
if (isset ($ a [$ this ->rdf .'datatype ' ])) {
429
425
$ s ['o_datatype ' ] = $ a [$ this ->rdf .'datatype ' ];
0 commit comments