Page MenuHomec4science

rdf-editor-component.component.ts
No OneTemporary

File Metadata

Created
Thu, Feb 20, 07:54

rdf-editor-component.component.ts

import { Component, OnInit } from '@angular/core';
import {Quad} from "n3";
import {Subscription} from "rxjs/index";
import {RdfServiceService} from "../../services/rdf-service.service";
@Component({
selector: 'app-rdf-editor-component',
templateUrl: './rdf-editor-component.component.html',
styleUrls: ['./rdf-editor-component.component.scss']
})
export class RdfEditorComponentComponent implements OnInit {
rdfJsData: Array<Quad>;
rdfJsDataSubscription: Subscription;
rdfJsPrefixes: any;
testRdf = `PREFIX c: <http://example.org/cartoons#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
c:Tom a c:Cat;
c:published "2013-08-26"^^xsd:date.
c:Jerry a c:Mouse;
c:smarterThan c:Tom.`;
constructor( private rdfService: RdfServiceService ) { }
ngOnInit() {
this.rdfService.parseRDF(this.testRdf);
this.rdfJsDataSubscription = this.rdfService.dataToEditEmitter.subscribe(data => {
this.rdfJsData = data;
console.log('this.rdfJsData coming from store: ', this.rdfJsData);
});
}
}

Event Timeline