SlideShare a Scribd company logo
1 of 24
$ git clone https://github.com/webr3/js3.git
$ git checkout origin/rdfa-api-integration



<script type=”text/javascript” src=”js3.js”></script>




var js3 = require(‘./js3.node.js’);
var context = new rdfapi.Context();
var parser = new rdfapi.parsers.Turtle(context);
var serializer = new rdfapi.serializers.Turtle(context);

var turtle_text = ‘@prefix ex: <http://example.com/people/> .¥
    @prefix foaf: <http://xmlns.com/foaf/0.1/> .¥
¥
    ex:taro a foaf:Person;¥
        foaf:name “Taro”;¥
        foaf:age 25 .’;

parser.parse(turtle_text, function(graph){
    console.log(serializer.serialize(graph));
});
parser.parse(turtle_text, function(graph){
    graph.forEach(function(triple){ // show each triples
        console.log(triple.toString());
    })

      graph.add(triple2); // add a triple to the graph

      // use filter
      var filter = rdfapi.filters.p(“owl:sameAs”);
      graph.some(filter);
      graph.every(filter);
      graph.filter(filter);

      graph.merge(other_graph);
});
var taro = {
    a: “foaf:Person”,
    name: “Taro Yamada”,
    age: new Date().getFullYear() - 1984,
    homepage: “http://example.com/home/taro”
}.ref(“http://example.com/rdf/taro”);

console.log(taro.n3());
var taro = {
    a: “foaf:Person”,
    name: “Taro Yamada”,
    age: new Date().getFullYear() - 1984,
    homepage: “http://example.com/home/taro”
}.ref(“http://example.com/rdf/taro”);

console.log(taro.n3());
var taro = {
    a: “foaf:Person”,
    name: “Taro Yamada”,
    age: new Date().getFullYear() - 1984,
    homepage: “http://example.com/home/taro”
}.ref(“http://example.com/rdf/taro”);

console.log(taro.n3());
var taro = {
    a: “foaf:Person”,
    name: “Taro Yamada”,
    age: new Date().getFullYear() - 1984,
    homepage: “http://example.com/home/taro”
}.ref(“http://example.com/rdf/taro”);

console.log(taro.n3());
var taro = {
    a: “foaf:Person”,
    name: “Taro Yamada”,
    age: new Date().getFullYear() - 1984,
    homepage: “http://example.com/home/taro”
}.ref(“http://example.com/rdf/taro”);

console.log(taro.n3());


                           ↓
var taro = {
    a: “foaf:Person”,
    name: “Taro Yamada”,
    age: new Date().getFullYear() - 1984,
    homepage: “http://example.com/home/taro”
}.ref(“http://example.com/rdf/taro”);

console.log(taro.n3());


                           ↓
   <http://example.com/rdf/taro> rdf:type foaf:Person;
       foaf:name “Taro Yamada”;
       foaf:age 27;
       foaf:homepage <http://example.com/home/taro> .
// TypedLiteral    .type      IRI            (       CURIE   )
(true).type;         //=>   xsd:boolean
(new Date()).type;   //=>   xsd:dateTime
(10).type;           //=>   xsd:integer
(3.14).type;         //=>   xsd:decimal

// .nodeType()    TypedLiteral, PlainLiteral, BlankNode, IRI
(10).nodeType();                      //=>   TypedLiteral
“hello”.nodeType();                   //=>   PlainLiteral
“_:b12”.nodeType();                   //=>   BlankNode
“foaf:name”.nodeType();               //=>   IRI
“http://example.com/”.nodeType();     //=>   IRI
// foaf:name   2
var me1 = { “foaf:nick”: [“nick”, “name”] }.ref();

// RDF List
var me2 = { “foaf:nick”: [“nick”, “name”].toList() }.ref();
var taro = {
    name: “Taro”,
    holdsAccount: {
        accountName: ‘xxx’,
        homepage: ‘http://twitter.com/xxx’,
    }
}.ref(“:taro”);




var jiro = { “foaf:knows”: taro }.ref(“:jiro”);
var me = { name: “Taro”, age: 27 }.ref(“:me”);
console.log(typeof me.age);                       //=> number
console.log((new Date()).getFullYear() - me.age); //=> 1984
console.log(me.name.toUpper());                   //=> “TARO”
// parsing by rdfapi.js
parser.parse(“SOME RDF STRING”, function(graph){
    var data = {
        a: “foaf:Document”,
        ...,
    }.ref(“:book”);

      graph.merge(data.graphify()); //
});
rdfapi.js and js3.js by webr3
rdfapi.js and js3.js by webr3

More Related Content

What's hot

MongoDB Advanced Topics
MongoDB Advanced TopicsMongoDB Advanced Topics
MongoDB Advanced TopicsCésar Rodas
 
Files in c
Files in cFiles in c
Files in cTanujaA3
 
Mengembalikan data yang terhapus atau rusak pada hardisk menggunakan ubuntu
Mengembalikan data yang terhapus atau rusak pada hardisk menggunakan ubuntuMengembalikan data yang terhapus atau rusak pada hardisk menggunakan ubuntu
Mengembalikan data yang terhapus atau rusak pada hardisk menggunakan ubuntuAlferizhy Chalter
 
Agente Inteligente Ontologia y Tripletas
Agente Inteligente Ontologia y TripletasAgente Inteligente Ontologia y Tripletas
Agente Inteligente Ontologia y Tripletasluisfe
 
Files and Directories in PHP
Files and Directories in PHPFiles and Directories in PHP
Files and Directories in PHPNicole Ryan
 
scdevsumit 2016 - Become a jedi with php streams
scdevsumit 2016 - Become a jedi with php streamsscdevsumit 2016 - Become a jedi with php streams
scdevsumit 2016 - Become a jedi with php streamsMatheus Marabesi
 
R- create a table from a list of files.... before webmining
R- create a table from a list of files.... before webminingR- create a table from a list of files.... before webmining
R- create a table from a list of files.... before webminingGabriela Plantie
 
TDC São Paulo 2016 - Become a jedi with php streams
TDC São Paulo 2016 - Become a jedi with php streamsTDC São Paulo 2016 - Become a jedi with php streams
TDC São Paulo 2016 - Become a jedi with php streamsMatheus Marabesi
 
Filing system in PHP
Filing system in PHPFiling system in PHP
Filing system in PHPMudasir Syed
 
Scala and big data in ICM. Scoobie, Scalding, Spark, Stratosphere. Scalar 2014
Scala and big data in ICM. Scoobie, Scalding, Spark, Stratosphere. Scalar 2014Scala and big data in ICM. Scoobie, Scalding, Spark, Stratosphere. Scalar 2014
Scala and big data in ICM. Scoobie, Scalding, Spark, Stratosphere. Scalar 2014Michał Oniszczuk
 
Php file handling in Hindi
Php file handling in Hindi Php file handling in Hindi
Php file handling in Hindi Vipin sharma
 
Php File Operations
Php File OperationsPhp File Operations
Php File Operationsmussawir20
 
Non-Relational Databases
Non-Relational DatabasesNon-Relational Databases
Non-Relational Databaseskchodorow
 
TDC2016SP - Become a jedi with PHP streams
TDC2016SP - Become a jedi with PHP streamsTDC2016SP - Become a jedi with PHP streams
TDC2016SP - Become a jedi with PHP streamstdc-globalcode
 
Class 7b: Files & File I/O
Class 7b: Files & File I/OClass 7b: Files & File I/O
Class 7b: Files & File I/OMarc Gouw
 

What's hot (20)

MongoDB Advanced Topics
MongoDB Advanced TopicsMongoDB Advanced Topics
MongoDB Advanced Topics
 
Files in c
Files in cFiles in c
Files in c
 
Php files
Php filesPhp files
Php files
 
Mengembalikan data yang terhapus atau rusak pada hardisk menggunakan ubuntu
Mengembalikan data yang terhapus atau rusak pada hardisk menggunakan ubuntuMengembalikan data yang terhapus atau rusak pada hardisk menggunakan ubuntu
Mengembalikan data yang terhapus atau rusak pada hardisk menggunakan ubuntu
 
Agente Inteligente Ontologia y Tripletas
Agente Inteligente Ontologia y TripletasAgente Inteligente Ontologia y Tripletas
Agente Inteligente Ontologia y Tripletas
 
Files and Directories in PHP
Files and Directories in PHPFiles and Directories in PHP
Files and Directories in PHP
 
scdevsumit 2016 - Become a jedi with php streams
scdevsumit 2016 - Become a jedi with php streamsscdevsumit 2016 - Become a jedi with php streams
scdevsumit 2016 - Become a jedi with php streams
 
R- create a table from a list of files.... before webmining
R- create a table from a list of files.... before webminingR- create a table from a list of files.... before webmining
R- create a table from a list of files.... before webmining
 
TDC São Paulo 2016 - Become a jedi with php streams
TDC São Paulo 2016 - Become a jedi with php streamsTDC São Paulo 2016 - Become a jedi with php streams
TDC São Paulo 2016 - Become a jedi with php streams
 
Sparql
SparqlSparql
Sparql
 
Filing system in PHP
Filing system in PHPFiling system in PHP
Filing system in PHP
 
Creating a phar
Creating a pharCreating a phar
Creating a phar
 
Scala and big data in ICM. Scoobie, Scalding, Spark, Stratosphere. Scalar 2014
Scala and big data in ICM. Scoobie, Scalding, Spark, Stratosphere. Scalar 2014Scala and big data in ICM. Scoobie, Scalding, Spark, Stratosphere. Scalar 2014
Scala and big data in ICM. Scoobie, Scalding, Spark, Stratosphere. Scalar 2014
 
Php file handling in Hindi
Php file handling in Hindi Php file handling in Hindi
Php file handling in Hindi
 
PHP file handling
PHP file handling PHP file handling
PHP file handling
 
Php File Operations
Php File OperationsPhp File Operations
Php File Operations
 
Be Lazy & Scale
Be Lazy & ScaleBe Lazy & Scale
Be Lazy & Scale
 
Non-Relational Databases
Non-Relational DatabasesNon-Relational Databases
Non-Relational Databases
 
TDC2016SP - Become a jedi with PHP streams
TDC2016SP - Become a jedi with PHP streamsTDC2016SP - Become a jedi with PHP streams
TDC2016SP - Become a jedi with PHP streams
 
Class 7b: Files & File I/O
Class 7b: Files & File I/OClass 7b: Files & File I/O
Class 7b: Files & File I/O
 

Viewers also liked

第1回Linked Data勉強会:ReDeFer
第1回Linked Data勉強会:ReDeFer第1回Linked Data勉強会:ReDeFer
第1回Linked Data勉強会:ReDeFerNoritada Shimizu
 
Linkeddata.jp study meeting #1
Linkeddata.jp study meeting #1Linkeddata.jp study meeting #1
Linkeddata.jp study meeting #1KAMURA
 
第1回LinkedData勉強会
第1回LinkedData勉強会第1回LinkedData勉強会
第1回LinkedData勉強会Fumihiro Kato
 
XLWrapについてのご紹介
XLWrapについてのご紹介XLWrapについてのご紹介
XLWrapについてのご紹介Ohsawa Goodfellow
 
SPARQL Timelinerの使い方
SPARQL Timelinerの使い方SPARQL Timelinerの使い方
SPARQL Timelinerの使い方uedayou
 
Linked data the next 5 years - From Hype to Action
Linked data the next 5 years - From Hype to ActionLinked data the next 5 years - From Hype to Action
Linked data the next 5 years - From Hype to ActionAndreas Blumauer
 
SPARQLを利用した逆マッシュアップ-プログラミングを必要としないアプリ作成方法-
SPARQLを利用した逆マッシュアップ-プログラミングを必要としないアプリ作成方法-SPARQLを利用した逆マッシュアップ-プログラミングを必要としないアプリ作成方法-
SPARQLを利用した逆マッシュアップ-プログラミングを必要としないアプリ作成方法-uedayou
 
Chainerの使い方と 自然言語処理への応用
Chainerの使い方と自然言語処理への応用Chainerの使い方と自然言語処理への応用
Chainerの使い方と 自然言語処理への応用Yuya Unno
 
自然言語処理のためのDeep Learning
自然言語処理のためのDeep Learning自然言語処理のためのDeep Learning
自然言語処理のためのDeep LearningYuta Kikuchi
 

Viewers also liked (11)

第1回Linked Data勉強会:ReDeFer
第1回Linked Data勉強会:ReDeFer第1回Linked Data勉強会:ReDeFer
第1回Linked Data勉強会:ReDeFer
 
Linkeddata.jp study meeting #1
Linkeddata.jp study meeting #1Linkeddata.jp study meeting #1
Linkeddata.jp study meeting #1
 
第1回LinkedData勉強会
第1回LinkedData勉強会第1回LinkedData勉強会
第1回LinkedData勉強会
 
XLWrapについてのご紹介
XLWrapについてのご紹介XLWrapについてのご紹介
XLWrapについてのご紹介
 
SPARQL Timelinerの使い方
SPARQL Timelinerの使い方SPARQL Timelinerの使い方
SPARQL Timelinerの使い方
 
Linked data the next 5 years - From Hype to Action
Linked data the next 5 years - From Hype to ActionLinked data the next 5 years - From Hype to Action
Linked data the next 5 years - From Hype to Action
 
SPARQLを利用した逆マッシュアップ-プログラミングを必要としないアプリ作成方法-
SPARQLを利用した逆マッシュアップ-プログラミングを必要としないアプリ作成方法-SPARQLを利用した逆マッシュアップ-プログラミングを必要としないアプリ作成方法-
SPARQLを利用した逆マッシュアップ-プログラミングを必要としないアプリ作成方法-
 
第7回 Linked Data 勉強会 @yayamamo
第7回 Linked Data 勉強会 @yayamamo第7回 Linked Data 勉強会 @yayamamo
第7回 Linked Data 勉強会 @yayamamo
 
Chainerの使い方と 自然言語処理への応用
Chainerの使い方と自然言語処理への応用Chainerの使い方と自然言語処理への応用
Chainerの使い方と 自然言語処理への応用
 
自然言語処理のためのDeep Learning
自然言語処理のためのDeep Learning自然言語処理のためのDeep Learning
自然言語処理のためのDeep Learning
 
深層学習による自然言語処理の研究動向
深層学習による自然言語処理の研究動向深層学習による自然言語処理の研究動向
深層学習による自然言語処理の研究動向
 

Similar to rdfapi.js and js3.js by webr3

JavaScript Survival Guide
JavaScript Survival GuideJavaScript Survival Guide
JavaScript Survival GuideGiordano Scalzo
 
Two graph data models : RDF and Property Graphs
Two graph data models : RDF and Property GraphsTwo graph data models : RDF and Property Graphs
Two graph data models : RDF and Property Graphsandyseaborne
 
Development and practical use of CLI in perl 6
Development and practical use of CLI in perl 6Development and practical use of CLI in perl 6
Development and practical use of CLI in perl 6risou
 
NoSQL and Triple Stores
NoSQL and Triple StoresNoSQL and Triple Stores
NoSQL and Triple Storesandyseaborne
 
Achieving Parsing Sanity In Erlang
Achieving Parsing Sanity In ErlangAchieving Parsing Sanity In Erlang
Achieving Parsing Sanity In ErlangSean Cribbs
 
Rdf In A Nutshell V1
Rdf In A Nutshell V1Rdf In A Nutshell V1
Rdf In A Nutshell V1Fabien Gandon
 
Mapping Relational Databases to Linked Data
Mapping Relational Databases to Linked DataMapping Relational Databases to Linked Data
Mapping Relational Databases to Linked DataEUCLID project
 
Yy
YyYy
Yyyygh
 
Yy
YyYy
Yyyygh
 
Nouveau document texte
Nouveau document texteNouveau document texte
Nouveau document texteSai Ef
 
SHACL in Apache jena - ApacheCon2020
SHACL in Apache jena - ApacheCon2020SHACL in Apache jena - ApacheCon2020
SHACL in Apache jena - ApacheCon2020andyseaborne
 
JavaScript - Like a Box of Chocolates - jsDay
JavaScript - Like a Box of Chocolates - jsDayJavaScript - Like a Box of Chocolates - jsDay
JavaScript - Like a Box of Chocolates - jsDayRobert Nyman
 
An introduction to Semantic Web and Linked Data
An introduction to Semantic Web and Linked DataAn introduction to Semantic Web and Linked Data
An introduction to Semantic Web and Linked DataGabriela Agustini
 

Similar to rdfapi.js and js3.js by webr3 (20)

Having Fun Programming!
Having Fun Programming!Having Fun Programming!
Having Fun Programming!
 
JavaScript Survival Guide
JavaScript Survival GuideJavaScript Survival Guide
JavaScript Survival Guide
 
Two graph data models : RDF and Property Graphs
Two graph data models : RDF and Property GraphsTwo graph data models : RDF and Property Graphs
Two graph data models : RDF and Property Graphs
 
Development and practical use of CLI in perl 6
Development and practical use of CLI in perl 6Development and practical use of CLI in perl 6
Development and practical use of CLI in perl 6
 
Cod
CodCod
Cod
 
Fisier.txt
Fisier.txtFisier.txt
Fisier.txt
 
C99
C99C99
C99
 
NoSQL and Triple Stores
NoSQL and Triple StoresNoSQL and Triple Stores
NoSQL and Triple Stores
 
Dades i operadors
Dades i operadorsDades i operadors
Dades i operadors
 
C99.php
C99.phpC99.php
C99.php
 
C99[2]
C99[2]C99[2]
C99[2]
 
Achieving Parsing Sanity In Erlang
Achieving Parsing Sanity In ErlangAchieving Parsing Sanity In Erlang
Achieving Parsing Sanity In Erlang
 
Rdf In A Nutshell V1
Rdf In A Nutshell V1Rdf In A Nutshell V1
Rdf In A Nutshell V1
 
Mapping Relational Databases to Linked Data
Mapping Relational Databases to Linked DataMapping Relational Databases to Linked Data
Mapping Relational Databases to Linked Data
 
Yy
YyYy
Yy
 
Yy
YyYy
Yy
 
Nouveau document texte
Nouveau document texteNouveau document texte
Nouveau document texte
 
SHACL in Apache jena - ApacheCon2020
SHACL in Apache jena - ApacheCon2020SHACL in Apache jena - ApacheCon2020
SHACL in Apache jena - ApacheCon2020
 
JavaScript - Like a Box of Chocolates - jsDay
JavaScript - Like a Box of Chocolates - jsDayJavaScript - Like a Box of Chocolates - jsDay
JavaScript - Like a Box of Chocolates - jsDay
 
An introduction to Semantic Web and Linked Data
An introduction to Semantic Web and Linked DataAn introduction to Semantic Web and Linked Data
An introduction to Semantic Web and Linked Data
 

Recently uploaded

Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 

Recently uploaded (20)

Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 

rdfapi.js and js3.js by webr3

  • 1.
  • 2.
  • 3. $ git clone https://github.com/webr3/js3.git $ git checkout origin/rdfa-api-integration <script type=”text/javascript” src=”js3.js”></script> var js3 = require(‘./js3.node.js’);
  • 4.
  • 5.
  • 6. var context = new rdfapi.Context(); var parser = new rdfapi.parsers.Turtle(context); var serializer = new rdfapi.serializers.Turtle(context); var turtle_text = ‘@prefix ex: <http://example.com/people/> .¥ @prefix foaf: <http://xmlns.com/foaf/0.1/> .¥ ¥ ex:taro a foaf:Person;¥ foaf:name “Taro”;¥ foaf:age 25 .’; parser.parse(turtle_text, function(graph){ console.log(serializer.serialize(graph)); });
  • 7. parser.parse(turtle_text, function(graph){ graph.forEach(function(triple){ // show each triples console.log(triple.toString()); }) graph.add(triple2); // add a triple to the graph // use filter var filter = rdfapi.filters.p(“owl:sameAs”); graph.some(filter); graph.every(filter); graph.filter(filter); graph.merge(other_graph); });
  • 8.
  • 9.
  • 10. var taro = { a: “foaf:Person”, name: “Taro Yamada”, age: new Date().getFullYear() - 1984, homepage: “http://example.com/home/taro” }.ref(“http://example.com/rdf/taro”); console.log(taro.n3());
  • 11. var taro = { a: “foaf:Person”, name: “Taro Yamada”, age: new Date().getFullYear() - 1984, homepage: “http://example.com/home/taro” }.ref(“http://example.com/rdf/taro”); console.log(taro.n3());
  • 12. var taro = { a: “foaf:Person”, name: “Taro Yamada”, age: new Date().getFullYear() - 1984, homepage: “http://example.com/home/taro” }.ref(“http://example.com/rdf/taro”); console.log(taro.n3());
  • 13. var taro = { a: “foaf:Person”, name: “Taro Yamada”, age: new Date().getFullYear() - 1984, homepage: “http://example.com/home/taro” }.ref(“http://example.com/rdf/taro”); console.log(taro.n3());
  • 14. var taro = { a: “foaf:Person”, name: “Taro Yamada”, age: new Date().getFullYear() - 1984, homepage: “http://example.com/home/taro” }.ref(“http://example.com/rdf/taro”); console.log(taro.n3()); ↓
  • 15. var taro = { a: “foaf:Person”, name: “Taro Yamada”, age: new Date().getFullYear() - 1984, homepage: “http://example.com/home/taro” }.ref(“http://example.com/rdf/taro”); console.log(taro.n3()); ↓ <http://example.com/rdf/taro> rdf:type foaf:Person; foaf:name “Taro Yamada”; foaf:age 27; foaf:homepage <http://example.com/home/taro> .
  • 16.
  • 17.
  • 18. // TypedLiteral .type IRI ( CURIE ) (true).type; //=> xsd:boolean (new Date()).type; //=> xsd:dateTime (10).type; //=> xsd:integer (3.14).type; //=> xsd:decimal // .nodeType() TypedLiteral, PlainLiteral, BlankNode, IRI (10).nodeType(); //=> TypedLiteral “hello”.nodeType(); //=> PlainLiteral “_:b12”.nodeType(); //=> BlankNode “foaf:name”.nodeType(); //=> IRI “http://example.com/”.nodeType(); //=> IRI
  • 19. // foaf:name 2 var me1 = { “foaf:nick”: [“nick”, “name”] }.ref(); // RDF List var me2 = { “foaf:nick”: [“nick”, “name”].toList() }.ref();
  • 20. var taro = { name: “Taro”, holdsAccount: { accountName: ‘xxx’, homepage: ‘http://twitter.com/xxx’, } }.ref(“:taro”); var jiro = { “foaf:knows”: taro }.ref(“:jiro”);
  • 21. var me = { name: “Taro”, age: 27 }.ref(“:me”); console.log(typeof me.age); //=> number console.log((new Date()).getFullYear() - me.age); //=> 1984 console.log(me.name.toUpper()); //=> “TARO”
  • 22. // parsing by rdfapi.js parser.parse(“SOME RDF STRING”, function(graph){ var data = { a: “foaf:Document”, ..., }.ref(“:book”); graph.merge(data.graphify()); // });

Editor's Notes

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n