How should i build a Knowledge Graph for a custom dataset?
You can build a Knowledge Graph from existing data sources too using 
RML.
RML stands for RDF Mapping Language and allows you to transform heterogeneous 
data sources into RDF and extends R2RML.
I created an example with JSON data as a data source, but other formats are 
possible such as CSV, XML, relational databases, etc.

RML (RDF Mapping Language)

Turning your existing data sources into RDF goes as followed with RML:


Write RML mapping rules which instruct an RML processor how the data should 
be transformed into RDF. 
You can find many example in the RML documentation how 
to write your mapping rules for your data sources.


RML rules consist of Triples Maps 
which on its own turn have the following parts:


Logical Source: How the data source 
should be accessed.
Subject Maps: How a subject of a triple
should be created.
Predicate-Object Maps: How a predicate 
and its object should be created.


Logical Source

rml:logicalSource [
    rml:source "people.json" ;
    rml:referenceFormulation ql:JSONPath ;
    rml:iterator "$.people.[*]" ; 
] ;


The data source people.json is accessed using JSONPath expressions defined as 
$.people.[*].
The expression allows the RML processor to iterate over the JSON data.

Subject Maps

rr:subjectMap [
    rr:template "http://ex.com/Person/{firstname}_{lastname}" ;
    rr:class foaf:Person ; 
] ;


Every subject created by this SubjectMap will look like 
http://ex.com/Person/{firstname}_{lastname} where firstname and lastname 
are replaced by the corresponding JSON values during the execution of an RML 
processor. The subject has the class foaf:Person.

Predicate-Object Maps

rr:predicateObjectMap [
        rr:predicate foaf:givenName ;
        rr:objectMap [ 
            rml:reference "firstname" ; 
        ] 
    ] ;


This map generates a predicate foaf:givenName where the object will receive
the JSON value firstname during the mapping process.


Execute your mapping rules with an RML processor. 
An example of an RML processor is the 
RML Mapper or the 
RML Streamer.
Other RML processors can be used too, if they comply with the 
RML specification.


An RML processor will generate the following triples from the JSON data based on
the mapping rules shown previously:

&lt;http://ex.com/Person/John_Doe&gt; &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#type&gt; &lt;http://xmlns.com/foaf/0.1/Person&gt;.
&lt;http://ex.com/Person/John_Doe&gt; &lt;http://xmlns.com/foaf/0.1/givenName&gt; "John".
&lt;http://ex.com/Person/John_Doe&gt; &lt;http://xmlns.com/foaf/0.1/familyName&gt; "Doe".
&lt;http://ex.com/Person/Jane_Smith&gt; &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#type&gt; &lt;http://xmlns.com/foaf/0.1/Person&gt;.
&lt;http://ex.com/Person/Jane_Smith&gt; &lt;http://xmlns.com/foaf/0.1/givenName&gt; "Jane".
&lt;http://ex.com/Person/Jane_Smith&gt; &lt;http://xmlns.com/foaf/0.1/familyName&gt; "Smith".
&lt;http://ex.com/Person/Sarah_Bladinck&gt; &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#type&gt; &lt;http://xmlns.com/foaf/0.1/Person&gt;.
&lt;http://ex.com/Person/Sarah_Bladinck&gt; &lt;http://xmlns.com/foaf/0.1/givenName&gt; "Sarah".
&lt;http://ex.com/Person/Sarah_Bladinck&gt; &lt;http://xmlns.com/foaf/0.1/familyName&gt; "Bladinck".


Full example

I created a small demo to create a FOAF Person with a first and last name:

RML Mapping rules

@base &lt;http://example.com&gt; .
@prefix rml: &lt;http://semweb.mmlab.be/ns/rml#&gt; .
@prefix rr: &lt;http://www.w3.org/ns/r2rml#&gt; .
@prefix ql: &lt;http://semweb.mmlab.be/ns/ql#&gt; .
@prefix foaf: &lt;http://xmlns.com/foaf/0.1/&gt; .

&lt;#PersonMapping&gt;
    a rr:TriplesMap ;
    rml:logicalSource [
        rml:source "people.json" ;
        rml:referenceFormulation ql:JSONPath ;
        rml:iterator "$.people.[*]" ; 
    ] ;

    rr:subjectMap [
        rr:template "http://ex.com/Person/{firstname}_{lastname}" ;
        rr:class foaf:Person ; 
    ] ;

    rr:predicateObjectMap [
        rr:predicate foaf:givenName ;
        rr:objectMap [ 
            rml:reference "firstname" ; 
        ] 
    ] ;

    rr:predicateObjectMap [
        rr:predicate foaf:familyName ;
        rr:objectMap [ 
            rml:reference "lastname" ; 
        ] 
    ] .



JSON data

{
    "people": [
        {
            "firstname": "John",
            "lastname": "Doe"
        },
        {
            "firstname": "Jane",
            "lastname": "Smith"
        },
        {
            "firstname": "Sarah",
            "lastname": "Bladinck"
        }
    ]
}


Note: I contribute to RML and its technologies.