@prefix :        <https://www.web3d.org/x3d/content/examples/Basic/development/LoadSensorPrototype.ttl#> .
@prefix owl:     <http://www.w3.org/2002/07/owl#> .
@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
@prefix schema:  <http://schema.org/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix xsd:     <http://www.w3.org/2001/XMLSchema#> .
@prefix x3d:     <https://www.web3d.org/specifications/x3d-4.1.xsd#> .
@prefix x3do:    <https://www.web3d.org/specifications/X3dOntology4.1#> .

:X3D a owl:NamedIndividual, x3do:X3D ;
  x3do:hasHead :head ;
  x3do:hasScene :Scene ;
  x3do:profile 'Immersive' ;
  x3do:version '3.0' ;
  x3do:noNamespaceSchemaLocation 'https://www.web3d.org/specifications/x3d-3.0.xsd' .
:head a owl:NamedIndividual, x3do:head ;
  x3do:hasParent :X3D ;
  x3do:hasMeta :meta_1_1, :meta_1_2, :meta_1_3, :meta_1_4, :meta_1_5, :meta_1_6, :meta_1_7, :meta_1_8, :meta_1_9, :meta_1_10, :meta_1_11, :meta_1_12, :meta_1_13, :meta_1_14 .
:meta_1_1 a owl:NamedIndividual, x3do:meta ;
  x3do:hasParent :head ;
  x3do:content 'LoadSensorPrototype.x3d' ;
  x3do:name 'title' .
:meta_1_2 a owl:NamedIndividual, x3do:meta ;
  x3do:hasParent :head ;
  x3do:content 'LoadSensor prototype for VRML 97 use, emulating X3D4 capabilities. Assumes correct loading of resources and provides output events based on timeOut delay. This design eventually led to adoption of LoadSensor in X3D 4.0 Architecture.' ;
  x3do:name 'description' .
:meta_1_3 a owl:NamedIndividual, x3do:meta ;
  x3do:hasParent :head ;
  x3do:content '26 December 2003' ;
  x3do:name 'created' .
:meta_1_4 a owl:NamedIndividual, x3do:meta ;
  x3do:hasParent :head ;
  x3do:content '7 September 2026' ;
  x3do:name 'modified' .
:meta_1_5 a owl:NamedIndividual, x3do:meta ;
  x3do:hasParent :head ;
  x3do:content 'Don Brutzman' ;
  x3do:name 'creator' .
:meta_1_6 a owl:NamedIndividual, x3do:meta ;
  x3do:hasParent :head ;
  x3do:content 'Set LoadSensorScript traceEnabled true/false to enable/disable console trace text.' ;
  x3do:name 'hint' .
:meta_1_7 a owl:NamedIndividual, x3do:meta ;
  x3do:hasParent :head ;
  x3do:content 'This LoadSensor implementation for VRML 97 only emulates LoadSensor events and cannot sense actual loading of watchList resources. Use an X3D-compliant browser for complete LoadSensor capability.' ;
  x3do:name 'warning' .
:meta_1_8 a owl:NamedIndividual, x3do:meta ;
  x3do:hasParent :head ;
  x3do:content 'X3D 4.01 draft Architecture, ISO/IEC 19775-1:202x, clause 9 Networking component, 9.4.4 LoadSensor' ;
  x3do:name 'specificationSection' .
:meta_1_9 a owl:NamedIndividual, x3do:meta ;
  x3do:hasParent :head ;
  x3do:content 'https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4.1-CD/Part01/components/networking.html#LoadSensor' ;
  x3do:name 'specificationUrl' .
:meta_1_10 a owl:NamedIndividual, x3do:meta ;
  x3do:hasParent :head ;
  x3do:content 'LoadSensorExample.x3d' ;
  x3do:name 'reference' .
:meta_1_11 a owl:NamedIndividual, x3do:meta ;
  x3do:hasParent :head ;
  x3do:content 'LoadSensorPrototypeInitializationTrace.txt' ;
  x3do:name 'reference' .
:meta_1_12 a owl:NamedIndividual, x3do:meta ;
  x3do:hasParent :head ;
  x3do:content 'https://www.web3d.org/x3d/content/examples/Basic/development/LoadSensorPrototype.x3d' ;
  x3do:name 'identifier' .
:meta_1_13 a owl:NamedIndividual, x3do:meta ;
  x3do:hasParent :head ;
  x3do:content 'X3D-Edit 4.0, https://www.web3d.org/x3d/tools/X3D-Edit' ;
  x3do:name 'generator' .
:meta_1_14 a owl:NamedIndividual, x3do:meta ;
  x3do:hasParent :head ;
  x3do:content '../license.html' ;
  x3do:name 'license' .
:meta dcterms:title "LoadSensorPrototype.x3d" .
:meta dcterms:description "LoadSensor prototype for VRML 97 use, emulating X3D4 capabilities. Assumes correct loading of resources and provides output events based on timeOut delay. This design eventually led to adoption of LoadSensor in X3D 4.0 Architecture." .
:meta dcterms:created "26 December 2003" .
:meta dcterms:modified "7 September 2026" .
:meta dcterms:creator "Don Brutzman" .
:meta dcterms:hint "Set LoadSensorScript traceEnabled true/false to enable/disable console trace text." .
:meta dcterms:warning "This LoadSensor implementation for VRML 97 only emulates LoadSensor events and cannot sense actual loading of watchList resources. Use an X3D-compliant browser for complete LoadSensor capability." .
:meta dcterms:reference "LoadSensorExample.x3d" .
:meta dcterms:reference "LoadSensorPrototypeInitializationTrace.txt" .
:meta dcterms:identifier "https://www.web3d.org/x3d/content/examples/Basic/development/LoadSensorPrototype.x3d" .
:meta dcterms:generator "X3D-Edit 4.0, https://www.web3d.org/x3d/tools/X3D-Edit" .
:meta dcterms:license "../license.html" .
:Scene a owl:NamedIndividual, x3do:Scene ;
  x3do:hasParent :X3D ;
  x3do:hasChildren :WorldInfo_2_1, :Anchor_2_3 ;
  x3do:hasProtoDeclare :ProtoDeclare_2_2 .
:WorldInfo_2_1 a owl:NamedIndividual, x3do:WorldInfo ;
  x3do:hasParent :Scene ;
  x3do:title 'LoadSensorPrototype.x3d' .
:ProtoDeclare_2_2 a owl:NamedIndividual, x3do:ProtoDeclare ;
  x3do:hasParent :Scene ;
  x3do:hasProtoInterface :ProtoInterface_2_2_1 ;
  x3do:hasProtoBody :ProtoBody_2_2_2 ;
  x3do:appinfo 'LoadSensor monitors the progress and success of downloading URL elements over a network. Only nodes that contain a valid URL field (i.e. descendants of X3DUrlObject) may be specified as watchList children. Multiple nodes may be watched with a single LoadSensor.' ;
  x3do:documentation 'https://www.web3d.org/specifications/ISO-IEC-19775/Part01/components/networking.html#LoadSensor' ;
  x3do:name 'LoadSensor' .
:ProtoInterface_2_2_1 a owl:NamedIndividual, x3do:ProtoInterface ;
  x3do:hasParent :ProtoDeclare_2_2 ;
  x3do:hasField :field_2_2_1_1, :field_2_2_1_2, :field_2_2_1_3, :field_2_2_1_4, :field_2_2_1_5, :field_2_2_1_6, :field_2_2_1_7, :field_2_2_1_8, :field_2_2_1_9 .
:field_2_2_1_1 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :ProtoInterface_2_2_1 ;
  x3do:accessType 'inputOutput' ;
  x3do:appinfo 'Enables/disables the sensor node.' ;
  x3do:name 'enabled' ;
  x3do:type 'SFBool' ;
  x3do:value true .
:field_2_2_1_2 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :ProtoInterface_2_2_1 ;
  x3do:accessType 'inputOutput' ;
  x3do:appinfo 'Maximum time for which the LoadSensor will monitor loading starting from when the sensor becomes active. timeOut=0 ordinarily indicates an indefinite time out period; i.e. the LoadSensor will wait until loading has completed either with success or failure timeOut=0 causes immediate loading for this implementation.' ;
  x3do:name 'timeOut' ;
  x3do:type 'SFTime' ;
  x3do:value '0' .
:field_2_2_1_3 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :ProtoInterface_2_2_1 ;
  x3do:accessType 'initializeOnly' ;
  x3do:appinfo 'Zero or more nodes with url fields to monitor.' ;
  x3do:name 'watchList' ;
  x3do:type 'MFNode' .
:field_2_2_1_4 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :ProtoInterface_2_2_1 ;
  x3do:accessType 'inputOnly' ;
  x3do:appinfo 'Change watchList MFNode array.' ;
  x3do:name 'set_watchList' ;
  x3do:type 'MFNode' .
:field_2_2_1_5 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :ProtoInterface_2_2_1 ;
  x3do:accessType 'outputOnly' ;
  x3do:appinfo 'isActive=true when loading begins isActive=false when loading ends.' ;
  x3do:name 'isActive' ;
  x3do:type 'SFBool' .
:field_2_2_1_6 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :ProtoInterface_2_2_1 ;
  x3do:accessType 'outputOnly' ;
  x3do:appinfo 'isLoaded=true when loading succeeds isLoaded=false when loading fails or timeOut reached.' ;
  x3do:name 'isLoaded' ;
  x3do:type 'SFBool' .
:field_2_2_1_7 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :ProtoInterface_2_2_1 ;
  x3do:accessType 'outputOnly' ;
  x3do:appinfo 'loadTime event is generated when loading has successfully completed.' ;
  x3do:name 'loadTime' ;
  x3do:type 'SFTime' .
:field_2_2_1_8 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :ProtoInterface_2_2_1 ;
  x3do:accessType 'outputOnly' ;
  x3do:appinfo 'progress [0..1] indicates fraction of loading complete.' ;
  x3do:name 'progress' ;
  x3do:type 'SFFloat' .
:field_2_2_1_9 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :ProtoInterface_2_2_1 ;
  x3do:accessType 'initializeOnly' ;
  x3do:appinfo 'associated Metadata node.' ;
  x3do:name 'metadata' ;
  x3do:type 'SFNode' .
:ProtoBody_2_2_2 a owl:NamedIndividual, x3do:ProtoBody ;
  x3do:hasParent :ProtoDeclare_2_2 ;
  x3do:hasChildren :Group_2_2_2_1 .
:Group_2_2_2_1 a owl:NamedIndividual, x3do:Group ;
  x3do:hasParent :ProtoBody_2_2_2 ;
  x3do:hasChildren :Clock, :LoadSensorScript, :Collision_2_2_2_1_6 ;
  x3do:hasROUTE :ROUTE_2_2_2_1_3, :ROUTE_2_2_2_1_4, :ROUTE_2_2_2_1_5 .
:Clock a owl:NamedIndividual, x3do:TimeSensor ;
  x3do:hasParent :Group_2_2_2_1 ;
  x3do:hasIS :IS_2_2_2_1_1_1 ;
  x3do:DEF 'Clock' ;
  x3do:loop true .
:IS_2_2_2_1_1_1 a owl:NamedIndividual, x3do:IS ;
  x3do:hasParent :Clock ;
  x3do:hasConnect :connect_2_2_2_1_1_1_1, :connect_2_2_2_1_1_1_2 .
:connect_2_2_2_1_1_1_1 a owl:NamedIndividual, x3do:connect ;
  x3do:hasParent :IS_2_2_2_1_1_1 ;
  x3do:nodeField 'enabled' ;
  x3do:protoField 'enabled' .
:connect_2_2_2_1_1_1_2 a owl:NamedIndividual, x3do:connect ;
  x3do:hasParent :IS_2_2_2_1_1_1 ;
  x3do:nodeField 'cycleInterval' ;
  x3do:protoField 'timeOut' .
:LoadSensorScript a owl:NamedIndividual, x3do:Script ;
  x3do:hasParent :Group_2_2_2_1 ;
  x3do:hasField :field_2_2_2_1_2_1, :field_2_2_2_1_2_2, :field_2_2_2_1_2_3, :field_2_2_2_1_2_4, :field_2_2_2_1_2_5, :field_2_2_2_1_2_6, :field_2_2_2_1_2_7, :field_2_2_2_1_2_8, :field_2_2_2_1_2_9, :field_2_2_2_1_2_10, :field_2_2_2_1_2_11 ;
  x3do:hasIS :IS_2_2_2_1_2_12 ;
  x3do:DEF 'LoadSensorScript' ;
  x3do:directOutput true ;
  x3do:sourceCode """
ecmascript:

function initialize ()
{
	enabled = ClockNode.enabled;
	tracePrint ('initialize() enabled=' + enabled);
	if (enabled)
	{
		isActive = true;
		// isLoaded event only sent upon completion
		progress = 0.0;
		tracePrintEvents ();
		timeOut = ClockNode.cycleInterval;
		tracePrint ('timeOut=' + timeOut);
		if (timeOut <= 0.0) // instantaneous, no loop
		{
			isActive = false;
			isLoaded = true;
			progress = 1.0;
			loadTime = timestamp;
			tracePrintEvents ();
		}
	}
}
function fraction (value, timestamp)
{
	enabled = ClockNode.enabled;
	if (enabled)
		tracePrint ('progress=' + value + ', priorFraction=' + priorFraction);
	// use priorFraction to check for looping, then stop loop
	if (enabled && ((value >=1) || (value < priorFraction)))
	{
		isActive = false;
		isLoaded = true;
		loadTime = timestamp;
		progress = 1;
		tracePrintEvents ();
		tracePrint ('complete');
                loopStart = true;
	}
	else progress= value; // output event
	priorFraction = progress;
}
function set_watchList (value, timestamp)
{
	watchList = value;
}
function tracePrintEvents ()
{
	tracePrint ('isActive=' + isActive);
	tracePrint ('isLoaded=' + isLoaded);
	tracePrint ('loadTime=' + loadTime);
	tracePrint ('progress=' + progress);
}
function tracePrint (outputString)
{
	if (traceEnabled) Browser.println ('[LoadSensor]' + outputString);
}
function alwaysPrint (outputString)
{
	Browser.println ('[LoadSensor]' + outputString);
}
""" .
:field_2_2_2_1_2_1 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :LoadSensorScript ;
  x3do:hasChildren :Clock-USE-1 ;
  x3do:accessType 'initializeOnly' ;
  x3do:name 'ClockNode' ;
  x3do:type 'SFNode' .
:Clock-USE-1 a owl:NamedIndividual, x3do:TimeSensor ;
  x3do:hasParent :field_2_2_2_1_2_1 ;
  owl:sameAs :Clock . # DEF matching this USE
:field_2_2_2_1_2_2 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :LoadSensorScript ;
  x3do:accessType 'outputOnly' ;
  x3do:name 'loopStart' ;
  x3do:type 'SFTime' .
:field_2_2_2_1_2_3 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :LoadSensorScript ;
  x3do:accessType 'inputOnly' ;
  x3do:name 'fraction' ;
  x3do:type 'SFFloat' .
:field_2_2_2_1_2_4 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :LoadSensorScript ;
  x3do:accessType 'initializeOnly' ;
  x3do:name 'priorFraction' ;
  x3do:type 'SFFloat' ;
  x3do:value 0 .
:field_2_2_2_1_2_5 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :LoadSensorScript ;
  x3do:accessType 'outputOnly' ;
  x3do:name 'progress' ;
  x3do:type 'SFFloat' .
:field_2_2_2_1_2_6 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :LoadSensorScript ;
  x3do:accessType 'initializeOnly' ;
  x3do:name 'watchList' ;
  x3do:type 'MFNode' .
:field_2_2_2_1_2_7 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :LoadSensorScript ;
  x3do:accessType 'inputOnly' ;
  x3do:name 'set_watchList' ;
  x3do:type 'MFNode' .
:field_2_2_2_1_2_8 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :LoadSensorScript ;
  x3do:accessType 'outputOnly' ;
  x3do:name 'isActive' ;
  x3do:type 'SFBool' .
:field_2_2_2_1_2_9 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :LoadSensorScript ;
  x3do:accessType 'outputOnly' ;
  x3do:name 'isLoaded' ;
  x3do:type 'SFBool' .
:field_2_2_2_1_2_10 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :LoadSensorScript ;
  x3do:accessType 'outputOnly' ;
  x3do:name 'loadTime' ;
  x3do:type 'SFTime' .
:field_2_2_2_1_2_11 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :LoadSensorScript ;
  x3do:accessType 'initializeOnly' ;
  x3do:name 'traceEnabled' ;
  x3do:type 'SFBool' ;
  x3do:value false .
:IS_2_2_2_1_2_12 a owl:NamedIndividual, x3do:IS ;
  x3do:hasParent :LoadSensorScript ;
  x3do:hasConnect :connect_2_2_2_1_2_12_1, :connect_2_2_2_1_2_12_2, :connect_2_2_2_1_2_12_3, :connect_2_2_2_1_2_12_4, :connect_2_2_2_1_2_12_5, :connect_2_2_2_1_2_12_6 .
:connect_2_2_2_1_2_12_1 a owl:NamedIndividual, x3do:connect ;
  x3do:hasParent :IS_2_2_2_1_2_12 ;
  x3do:nodeField 'watchList' ;
  x3do:protoField 'watchList' .
:connect_2_2_2_1_2_12_2 a owl:NamedIndividual, x3do:connect ;
  x3do:hasParent :IS_2_2_2_1_2_12 ;
  x3do:nodeField 'set_watchList' ;
  x3do:protoField 'set_watchList' .
:connect_2_2_2_1_2_12_3 a owl:NamedIndividual, x3do:connect ;
  x3do:hasParent :IS_2_2_2_1_2_12 ;
  x3do:nodeField 'isActive' ;
  x3do:protoField 'isActive' .
:connect_2_2_2_1_2_12_4 a owl:NamedIndividual, x3do:connect ;
  x3do:hasParent :IS_2_2_2_1_2_12 ;
  x3do:nodeField 'isLoaded' ;
  x3do:protoField 'isLoaded' .
:connect_2_2_2_1_2_12_5 a owl:NamedIndividual, x3do:connect ;
  x3do:hasParent :IS_2_2_2_1_2_12 ;
  x3do:nodeField 'loadTime' ;
  x3do:protoField 'loadTime' .
:connect_2_2_2_1_2_12_6 a owl:NamedIndividual, x3do:connect ;
  x3do:hasParent :IS_2_2_2_1_2_12 ;
  x3do:nodeField 'progress' ;
  x3do:protoField 'progress' .
:ROUTE_2_2_2_1_3 a owl:NamedIndividual, x3do:ROUTE ;
  x3do:hasParent :Group_2_2_2_1 ;
  x3do:fromField 'loopStart' ;
  x3do:fromNode 'LoadSensorScript' ;
  x3do:toField 'startTime' ;
  x3do:toNode 'Clock' .
:ROUTE_2_2_2_1_4 a owl:NamedIndividual, x3do:ROUTE ;
  x3do:hasParent :Group_2_2_2_1 ;
  x3do:fromField 'isActive' ;
  x3do:fromNode 'LoadSensorScript' ;
  x3do:toField 'enabled' ;
  x3do:toNode 'Clock' .
:ROUTE_2_2_2_1_5 a owl:NamedIndividual, x3do:ROUTE ;
  x3do:hasParent :Group_2_2_2_1 ;
  x3do:fromField 'fraction_changed' ;
  x3do:fromNode 'Clock' ;
  x3do:toField 'fraction' ;
  x3do:toNode 'LoadSensorScript' .
:Collision_2_2_2_1_6 a owl:NamedIndividual, x3do:Collision ;
  x3do:hasParent :Group_2_2_2_1 ;
  x3do:hasIS :IS_2_2_2_1_6_1 ;
  x3do:enabled false .
:IS_2_2_2_1_6_1 a owl:NamedIndividual, x3do:IS ;
  x3do:hasParent :Collision_2_2_2_1_6 ;
  x3do:hasConnect :connect_2_2_2_1_6_1_1 .
:connect_2_2_2_1_6_1_1 a owl:NamedIndividual, x3do:connect ;
  x3do:hasParent :IS_2_2_2_1_6_1 ;
  x3do:nodeField 'proxy' ;
  x3do:protoField 'metadata' .
:Anchor_2_3 a owl:NamedIndividual, x3do:Anchor ;
  x3do:hasParent :Scene ;
  x3do:hasChildren :Shape_2_3_1 ;
  x3do:description 'LoadSensorExample' ;
  x3do:parameter '"target=_blank"' ;
  x3do:url '"LoadSensorExample.x3d" "https://www.web3d.org/x3d/content/examples/Basic/development/LoadSensorExample.x3d" "LoadSensorExample.wrl" "https://www.web3d.org/x3d/content/examples/Basic/development/LoadSensorExample.wrl"' .
:Shape_2_3_1 a owl:NamedIndividual, x3do:Shape ;
  x3do:hasParent :Anchor_2_3 ;
  x3do:hasGeometry :Text_2_3_1_1 ;
  x3do:hasAppearance :Appearance_2_3_1_2 .
:Text_2_3_1_1 a owl:NamedIndividual, x3do:Text ;
  x3do:hasParent :Shape_2_3_1 ;
  x3do:hasFontStyle :FontStyle_2_3_1_1_1 ;
  x3do:string '"LoadSensorPrototype" "defines a prototype" "" "Click on this text to see" "LoadSensorExample scene"' .
:FontStyle_2_3_1_1_1 a owl:NamedIndividual, x3do:FontStyle ;
  x3do:hasParent :Text_2_3_1_1 ;
  x3do:justify '"MIDDLE" "MIDDLE"' ;
  x3do:size 0.7 .
:Appearance_2_3_1_2 a owl:NamedIndividual, x3do:Appearance ;
  x3do:hasParent :Shape_2_3_1 ;
  x3do:hasMaterial :Material_2_3_1_2_1 .
:Material_2_3_1_2_1 a owl:NamedIndividual, x3do:Material ;
  x3do:hasParent :Appearance_2_3_1_2 ;
  x3do:diffuseColor ( 1 1 0.2 ) .
