public function parseJSKOS(PrettyJsonSerializable $jskos): EasyRdf_Graph
    {
        if (!$this->context) {
            $this->context = json_decode(file_get_contents(__DIR__.'/jskos-context.json'));
        }
        
        if ($jskos instanceof Set) {
            $json = '{"@graph":'.json_encode($jskos->jsonLDSerialize('', true)).'}';
        } else {
            $json = json_encode($jskos->jsonLDSerialize('', true));
        }

        $rdf = JsonLD::toRdf($json, ['expandContext' => $this->context]);
        # TODO: catch (\ML\JsonLD\Exception\JsonLdException $e)

        $graph = new EasyRdf_Graph();
        $this->parse($graph, $rdf);

        return $graph;
    }
public function parseJSKOS(PrettyJsonSerializable $jskos): EasyRdf_Graph
    {
        if (!$this->context) {
            $this->context = json_decode(file_get_contents(__DIR__.'/jskos-context.json'));
        }
        
        if ($jskos instanceof Set) {
            $json = '{"@graph":'.json_encode($jskos->jsonLDSerialize('', true)).'}';
        } else {
            $json = json_encode($jskos->jsonLDSerialize('', true));
        }

        $rdf = JsonLD::toRdf($json, ['expandContext' => $this->context]);
        # TODO: catch (\ML\JsonLD\Exception\JsonLdException $e)

        $graph = new EasyRdf_Graph();
        $this->parse($graph, $rdf);

        return $graph;
    }
public function parseJSKOS ( PrettyJsonSerializable $ jskos ) : EasyRdf_Graph { if ( ! $ this -> context ) { $ this -> context = json_decode ( file_get_contents ( __DIR__ . '/jskos-context.json' ) ) ; } if ( $ jskos instanceof Set ) { $ json = '{"@graph":' . json_encode ( $ jskos -> jsonLDSerialize ( '' , true ) ) . '}' ; } else { $ json = json_encode ( $ jskos -> jsonLDSerialize ( '' , true ) ) ; } $ rdf = JsonLD :: toRdf ( $ json , [ 'expandContext' => $ this -> context ] ) ; # TODO: catch (\ML\JsonLD\Exception\JsonLdException $e) $ graph = new EasyRdf_Graph ( ) ; $ this -> parse ( $ graph , $ rdf ) ; return $ graph ; }
Parse JSKOS Resources to RDF.
Parse JSKOS Resources to RDF .