Project

General

Profile

« Previous | Next » 

Revision 53733

JSON-LD:
expand Dataset to use issn, headline, alternativeHeadline for dataset subtitle
fix Dataset issue to get the proper value when title is array
Add jsonld in search pages with potentialAction search to each page

View differences:

jsonld-document-serializer.service.ts
35 35
		buffer["@context"] = "http://schema.org";
36 36
		buffer["@type"] = "Dataset";
37 37
		this.serializeDocument(doc, buffer);
38
		if(doc.headline){
39
			buffer["headline"] = doc.headline;
40
		}
41
		if(doc.alternativeHeadline){
42
			buffer["alternativeHeadline"] = doc.alternativeHeadline;
43
		}
44
		if(doc.issn){
45
			buffer["issn"] = doc.issn;
46
		}
38 47

  
39 48
		if (doc.creator && doc.creator.length == 1) {
40 49
			buffer["creator"] = this.buildCreator(doc.creator[0]);
......
150 159
	}
151 160

  
152 161
	buildCreator(item: Person): any {
153
		return {
154
			"@type": "Person",
155
			"givenName": item.givenName,
156
			"familyName": item.familyName,
157
			"name": item.name
158
		};
162
		var person ={};
163
		person["@type"] = "Person";
164
		if(item.givenName){
165
			person["givenName"] = item.givenName;
166
		}
167
		if(item.familyName){
168
			person["familyName"] = item.familyName;
169
		}
170
		person["name"] = item.name;
171
		return person;
172
		// return {
173
		// 	"@type": "Person",
174
		// 	"givenName": item.givenName,
175
		// 	"familyName": item.familyName,
176
		// 	"name": item.name
177
		// };
159 178
	}
160 179

  
161 180
	buildLicense(item: License): any {

Also available in: Unified diff