Skip to content

Commit a6aafa0

Browse files
committed
Fixed turtle serializer
1 parent 7c128c6 commit a6aafa0

File tree

1 file changed

+8
-4
lines changed
  • src/main/java/ldbc/socialnet/dbgen/serializer

1 file changed

+8
-4
lines changed

src/main/java/ldbc/socialnet/dbgen/serializer/Turtle.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -530,19 +530,21 @@ public void serialize(Organization organization) {
530530
StringBuffer result = new StringBuffer(19000);
531531
writeDBPData(DBP.fullPrefixed(organization.name), RDF.type, DBPOWL.Organisation);
532532
writeDBPData(DBP.fullPrefixed(organization.name), FOAF.Name, createLiteral(organization.name));
533-
writeDBPData(DBP.fullPrefixed(organization.name), SNVOC.id, createLiteral(Long.toString(organization.id)));
534533
createTripleSPO(result, DBP.fullPrefixed(organization.name),
535534
SNVOC.locatedIn, DBP.fullPrefixed(locationDic.getLocationName(organization.location)));
535+
createTripleSPO(result, DBP.fullPrefixed(organization.name),
536+
SNVOC.id, createLiteral(Long.toString(organization.id)));
536537
toWriter(result.toString());
537538
}
538539

539540
@Override
540541
public void serialize(Tag tag) {
541542
StringBuffer result = new StringBuffer(350);
542543
writeDBPData(DBP.fullPrefixed(tag.name), FOAF.Name, createLiteral(tag.name));
543-
writeDBPData(DBP.fullPrefixed(tag.name), SNVOC.id, createLiteral(Long.toString(tag.id)));
544544
Integer tagClass = tag.tagClass;
545545
writeDBPData(DBP.fullPrefixed(tag.name), RDF.type, DBPOWL.prefixed(tagDic.getClassName(tagClass)));
546+
createTripleSPO(result, DBP.fullPrefixed(tag.name), SNVOC.id, createLiteral(Long.toString(tag.id)));
547+
toWriter(result.toString());
546548
}
547549

548550
@Override
@@ -560,7 +562,7 @@ public void serialize(Location location) {
560562
writeDBPData(DBP.fullPrefixed(name), RDF.type, DBPOWL.Place);
561563
writeDBPData(DBP.fullPrefixed(name), RDF.type, type);
562564
writeDBPData(DBP.fullPrefixed(name), FOAF.Name, createLiteral(name));
563-
writeDBPData(DBP.fullPrefixed(name), SNVOC.id, createLiteral(Long.toString(location.getId())));
565+
createTripleSPO(result, DBP.fullPrefixed(name), SNVOC.id, createLiteral(Long.toString(location.getId())));
564566
if (location.getType() != Location.CONTINENT) {
565567
String countryName = locationDic.getLocationName(locationDic.belongsTo(location.getId()));
566568
createTripleSPO(result, DBP.fullPrefixed(name), SNVOC.isPartOf, DBP.fullPrefixed(countryName));
@@ -575,10 +577,12 @@ public void serialize(TagClass tagClass) {
575577
if (tagClass.name.equals("Thing")) {
576578
writeDBPData("<http://www.w3.org/2002/07/owl#Thing>", RDFS.label, createLiteral(tagDic.getClassLabel(tagClass.id)));
577579
createTripleSPO(result, "<http://www.w3.org/2002/07/owl#Thing>", RDF.type, SNVOC.TagClass);
580+
createTripleSPO(result, "<http://www.w3.org/2002/07/owl#Thing>", SNVOC.id, Long.toString(tagClass.id));
578581
toWriter(result.toString());
579582
} else {
580583
writeDBPData(DBPOWL.prefixed(tagDic.getClassName(tagClass.id)), RDFS.label, createLiteral(tagDic.getClassLabel(tagClass.id)));
581584
createTripleSPO(result, DBP.fullPrefixed(tagDic.getClassName(tagClass.id)), RDF.type, SNVOC.TagClass);
585+
createTripleSPO(result, DBP.fullPrefixed(tagDic.getClassName(tagClass.id)), SNVOC.id, Long.toString(tagClass.id));
582586
toWriter(result.toString());
583587
}
584588
Integer parent = tagDic.getClassParent(tagClass.id);
@@ -638,7 +642,7 @@ private String getStaticNamespaces() {
638642
createPrefixLine(result, FOAF.PREFIX, FOAF.NAMESPACE);
639643
createPrefixLine(result, DBP.PREFIX, DBP.NAMESPACE);
640644
createPrefixLine(result, DBPOWL.PREFIX, DBPOWL.NAMESPACE);
641-
createPrefixLine(result, SNVOC.PREFIX, SNVOC.NAMESPACE);
645+
// createPrefixLine(result, SNVOC.PREFIX, SNVOC.NAMESPACE);
642646
return result.toString();
643647
}
644648

0 commit comments

Comments
 (0)